Suggestions |
Outlook instructions from other programs
|
1 Access to Outlook 2 Email properties 3 Email-drafts 4 Emails in PostOUT 5 Sent emails 6 Received emails 7 Contacts 8 Distributionlist 9 Notes 10 Appointments 11 Meeting requests 12 Tasks 13 Taskrequests 14 Journalitems 15 Post items |
1.1.1 Outlook hasn't been loaded: the method CreateObject with CreateObject("Outlook.Application") x=.GetNamespace("MAPI").GetDefaultFolder(6).Items.count
End With'CreateObject' doesn't recognize Outlook typenames, only Outlookconstants. E.g. the typename of map 'PostIN' is in VBA olFolderInbox; the Outlookconstant for this map is 6. x=CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items.count 1.1.2 Outlook has been loaded: the method Getobject With Getobject(,"Outlook.Application") x=.GetNamespace("MAPI").GetDefaultFolder(6).Items.Count
End With1.1.3 Load the Outlook-VBA-library The method 'references': independent whether Outlook has been loaded or not.manually: VBEditor/ MenuBar / Extra / References / Microsoft Outlook 11.0 Object Library /check
' Outlook 2000
' Outlook 2003 ' Outlook 2007 sub referentie()
ThisWorkbook.VBProject.References.AddFromFile "msoutl9.olb"
ThisWorkbook.VBProject.References.AddFromFile "msoutl10.olb"
ThisWorkbook.VBProject.References.AddFromFile "msoutl11.olb"
End subwith Outlook
x=.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items.Count
end withThe examples in this page use the Method 'CreateObject'. 1.2.1 Inventory of defautfolders
' Deleted items (olFolderDeletedItems)
' PostOUT (olFolderOutbox) ' Sent items (olFolderSentItems) ' PostIN (olFolderInbox) ' Calendar (olFolderCalendar) ' Contacts (olfolderContacts) ' Journal (olFolderJournal) ' Notes (olFolderNotes) ' Tasks (olFolderTasks) ' Reminders ' Reminders ' Drafts (olFolderDrafts) Sub mappen_defaultmappen()
With CreateObject("Outlook.Application").GetNamespace("MAPI")
End Sub
c01 = .GetDefaultFolder(3).Name
End Withc02 = .GetDefaultFolder(4).Name c03 = .GetDefaultFolder(5).Name c04 = .GetDefaultFolder(6).Name c05 = .GetDefaultFolder(9).Name c06 = .GetDefaultFolder(10).Name c07 = .GetDefaultFolder(11).Name c08 = .GetDefaultFolder(12).Name c09 = .GetDefaultFolder(13).Name c10 = .GetDefaultFolder(14).Name c11 = .GetDefaultFolder(15).Name c12 = .GetDefaultFolder(16).Name - appointment - contact - task - journal - note - 'sticker' (Post-it) - distributionlist some items are connected items like - taskrequest - meetingrequest Outlook distinguishes emails according to the folders they are stored in: - draft email : in folder Drafts GetDefaultFolder(16) - email : in map PostOUT GetDefaultFolder(4) - sent email : in map Sent items GetDefaultFolder(5) - received email : in map PostIN GetDefaultFolder(6) 1.3.1 Inventory of standard items
' email (olMailItem)
' appointment (olAppointmentItem) ' contact/recipient (olContactItem) ' task (olTaskItem) ' journal (olJournalItem) ' note (olNoteItem) ' sticker (olPostItem) ' distributionlist (olDistributionListItem) Sub items_standarditems()
With CreateObject("Outlook.Application")
End Sub.CreateItem(0)
End With.CreateItem(1) .CreateItem(2) .CreateItem(3) .CreateItem(4) .CreateItem(5) .CreateItem(6) .CreateItem(7) For every kind of outlookitem the most common actions will be discussed: - to create a new item - to read, adapt, move or delete an exisiting item - to filter existing items and read, adapt, move or delete those filtered items - to search for existing items and read, adapt, move or delete the found item(s) Sub email__properties()
With CreateObject("Outlook.application").GetNamespace("MAPI").GetDefaultFolder(6).Items(1)
End Subc0 = .Actions.Count
End WithFor Each ac In .Actions d01 = ac.Application
Nextd02 = ac.Class d03 = ac.CopyLike d04 = ac.Enabled d05 = ac.MessageClass d06 = ac.Name d07 = ac.Parent d08 = ac.prefix d09 = ac.ReplyStyle d010 = ac.ResponseStyle d011 = ac.Session d012 = ac.ShowOn c01 = .AlternateRecipientAllowed c02 = .Application c03 = .Attachments.Count c04 = .AutoForwarded c05 = .BCC c06 = .BillingInformation c07 = .body c08 = .Categories c09 = .CC c010 = .Class c011 = .Companies c012 = .ConversationIndex c013 = .ConversationTopic c014 = .CreationTime c015 = .DeferredDeliveryTime c016 = .DeleteAfterSubmit c017 = .entryId c018 = .ExpiryTime c019 = .FlagDueBy c020 = .FlagRequest c021 = .FlagStatus C022 = .FormDescription c023 = .GetInspector c024 = .HTMLBody c025 = .Importance c026 = .LastModificationTime c027 = .links.Count c028 = .MessageClass c029 = .Mileage c030 = .NoAging c031 = .OriginatorDeliveryReportRequested c032 = .OutlookInternalVersion c033 = .OutlookVersion c034 = .Parent c035 = .ReadReceiptRequested c036 = .ReceivedByEntryID c037 = .ReceivedByName c038 = .ReceivedOnBehalfOfEntryID c039 = .ReceivedOnBehalfOfName c040 = .ReceivedTime c041 = .RecipientReassignmentProhibited c042 = .Recipients.Count For Each rp In .Recipients d01 = rp.Name
Nextd02 = rp.address d03 = rp.Name c043 = .ReminderOverrideDefault c044 = .ReminderPlaySound c045 = .ReminderSet c046 = .ReminderSoundFile c047 = .ReminderTime c048 = .RemoteStatus c049 = .ReplyRecipientNames c050 = .ReplyRecipients.Count c051 = .Saved c052 = .SaveSentMessageFolder c053 = .SenderName c054 = .Sensitivity c055 = .Sent c056 = .SentOn c057 = .sentonbehalfofname c058 = .Session c059 = .Size c060 = .subject c061 = .Submitted c062 = .To c063 = .UnRead c064 = .UserProperties.Count c065 = .VotingOptions c066 = .VotingResponse The post will be stored automatically in the folder 'Drafts': GetDefaultFolder(16). Sub email_concept_new()
With CreateObject("Outlook.Application").CreateItem(0)
End Sub.Subject = "controle"
End With.To = "snb@forum.eu" .Save 3.1.2.1 New email draft to several addresses Sub email_concept_new_more_addresses()
With CreateObject("Outlook.Application").CreateItem(0)
End Sub.subject = "controle"
End With.To = "snb@forum.eu;bb@gmail.com;extra@planet.nl" .Save 3.1.2.2 New email draft to several CC-addresses Sub email_concept_new_more_CCaddresses()
With CreateObject("Outlook.Application").CreateItem(0)
End Sub.subject = "controle"
End With.To = "snb@forum.eu" .CC = "aaa@webforums.eu;bb@gmail.com;extra@planet.nl" .Save 3.1.2.3 New email draft to several BCC-addresses Sub email_concept_new_more_BCCaddresses()
With CreateObject("Outlook.Application").CreateItem(0)
End Sub.subject = "controle"
End With.To = "snb@forum.eu" .BCC = "aaa@webforums.eu;bb@gmail.com;extra@planet.nl" .Save 3.1.3.1 New email draft add recipients The methode Recipients.Add can only be aplied to existing contacts in the folder Contacts.Sub email_concept_new_recipients_To_add()
With CreateObject("Outlook.Application").CreateItem(0)
End Sub.subject = "controle"
End With.To = "snb@forum.eu" .Recipients.Add "aaa@webforums.eu;bb@gmail.com;extra" .Save 3.1.3.2 New email draft add CC recipients Sub email_concept_new_recipients_CC_add()
With CreateObject("Outlook.Application").CreateItem(0)
End Sub.subject = "controle"
End With.To = "snb@forum.eu" .Recipients.Add("aaa@webforums.eu;bb@gmail.com;extra").Type = 4 .Save 3.1.3.3 New email draft add BCC recipients Sub email_concept_new_recipients_BCC_add()
With CreateObject("Outlook.Application").CreateItem(0)
End Sub.subject = "controle"
End With.To = "snb@forum.eu" .Recipients.Add("aaa@webforums.eu;bb@gmail.com;extra").Type = 3 .Save 3.1.4 New email draft add attachments Sub email_concept_attachments_add()
With CreateObject("Outlook.Application").CreateItem(0)
End Sub.subject = "controle"
End With.To = "aaa@webforums.eu" .attachments.add "E:\OF\bestand1.xls" .attachments.add "E:\OF\bestand2.xls" .Save Sub email_concept_read()
c00 = "controle" 'you can refer to a email draft by its 'subject'.
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(16).Items(c00) c01 = .To
End Withc02 = .subject c03 = .body 3.2.2 Email draft: move to another folder Sub email_concept_move()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(16).Items(c00).Move .GetDefaultFolder(3)
End WithSub email_concept_delete()
c00 = "controle"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(16).Items(c00).Delete Sub email_concept_adapt()
c00 = "controle"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(16).Items(c00).subject = "new subject" 3.3.1 Email drafts: filter and read Sub email_concepten_filter_read()
c00 = "controle"
End SubFor Each it InCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(16).Items.Restrict("[Subject]='" & c00 & "'") c01 = c01 & "|" & it.body
Next3.3.2 Email drafts: filter and move to another folder Sub email_concepten_filter_move()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") For Each it In .GetDefaultFolder(16).Items.Restrict("[Subject]='" & c00 & "'")
End Withit.Move .GetDefaultFolder(3)
Next3.3.3 Email drafts: filter and delete Sub email_concepten_filter_delete()
c00 = "controle"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(16).Items.Restrict("[Subject]='" & c00 & "'") it.Delete
Next3.3.4 Email drafts: filter and adapt Sub email_concepten_filter_adapt()
c00 = "controle"
End Subc01 = "new subject" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(16).Items.Restrict("[Subject]='" & c00 & "'") With it
Next.subject = c01
End With.Save 3.4.1 Email draft: find and read Sub email_concepten_find_read()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(16).Items c01 = .Find("[Subject]='" & c00 & "'").body
End WithDo Until Err.Number <>0 c01 = c01 & "|" & .FindNext.body
Loop3.4.2 Email drafts: find and move to another folder Sub email_concepten_find_move()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(16).Items .Find("[Subject]='" & c00 & "'").Move .Application.GetNamespace("MAPI").GetDefaultFolder(3)
End WithDo Until Err.Number <>0 .FindNext.Move .Application.GetNamespace("MAPI").GetDefaultFolder(3)
Loop3.4.3 Email drafts find and delete Sub email_concepten_find_delete()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(16).Items .Find("[Subject]='" & c00 & "'").Delete
End WithDo Until Err.Number <>0 .FindNext.Delete
Loop3.4.4 Email drafts find and adapt Sub email_concepten_find_adapt()
On Error Resume Next
End Subc00 = "controle" c01 = "new subject" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(16).Items With .Find("[Subject]='" & c00 & "'")
End With.subject = c01
End With.Save Do Until Err.Number <>0 With .FindNext
Loop.subject = c01
End With
.Save They will be stored automatically in the folder PostOUT: GetDefaultFolder(4) until they have been sent. Sub email_new()
With CreateObject("Outlook.Application").CreateItem(0)
End Sub.To = "snb@webforums.eu"
End With.subject = "controle" .body = "bodytext" .send Sub email_new_html()
With CreateObject("Outlook.Application").CreateItem(0)
End Sub.To = "snb@webforum.eu"
End With.subject = "controle blusser A230" .HTMLBody = "<'a href=""http://office.webforums.eu/"">Office forum" .Save Sub email_read()
c00 = "controle"
End Subc01= CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(4).Items(c00).body 4.2.2 Email move to another folder Sub email_move()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(4).Items(c00).Move .GetDefaultFolder(16)
End WithSub email_delete()
c00 = "controle"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(4).Items(c00).Delete Sub email_adapt()
c00 = "controle"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(4).Items(c00).subject = "new subject" Sub emails_filter_read()
c00 = "controle"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(4).Items.Restrict("[Subject]='" & c00 & "'") c01 = c01 & "|" & it.body
Next4.3.2 Emails: filter and move to another folder Sub emails_filter_move()
c00 = "controle"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(4).Items.Restrict("[Subject]='" & c00 & "'") it.Move .application.getnamespace("MAPI").GetDefaultFolder(16)
Next4.3.3 Emails: filter and delete Sub emails_filter_delete()
c00 = "controle"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(4).Items.Restrict("[Subject]='" & c00 & "'") it.Delete
Next4.3.4 Emails: filter and adapt Sub emails_filter_adapt()
c00 = "controle"
End Subc01 = "new subject" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(4).Items.Restrict("[Subject]='" & c00 & "'") With it
Next.subject = c01
end with.Save Sub emails_find_read()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(4).Items c01 = .Find("[Subject]='" & c00 & "'").body
End WithDo Until Err.Number <>0 c01 = c01 & "|" & .FindNext.body
Loop4.4.2 Emails: find and move to another folder Sub emails_find_move()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(4).Items.Find("[Subject]='" & c00 & "'").Move .GetDefaultFolder(16)
End WithDo Until Err.Number <>0 .GetDefaultFolder(4).Items.FindNext.Move .GetDefaultFolder(16)
LoopSub emails_find_delete()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(4).Items .Find("[Subject]='" & c00 & "'").Delete
End WithDo Until Err.Number <>0 .FindNext.Delete
LoopSub emails_find_adapt()
On Error Resume Next
End Subc00 = "controle" c01 = "new subject" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(4).Items With .Find("[Subject]='" & c00 & "'")
End With.subject = c01
End With.Save Do Until Err.Number <>0 With .FindNext
Loop.subject = c01
End With.Save All items will be moved automatically to the folder Sent: GetDefaultFolder(5). Sub email_verzonden_read()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(5).Items(c00) c01 = .To & " " & .subject & " " & .body
End With5.2.2 Sent email: move to another folder Sub email_verzonden_move()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(5).Items(c00).Move .GetDefaultFolder(3)
End WithSub email_verzonden_delete()
c00 = "controle"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(5).Items(c00).Delete Sub email_verzonden_adapt()
c00 = "controle"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(5).Items(c00).subject = "new subject" 5.3.1 Sent Emails: filter and read Sub emails_verzonden_filter_read()
c00 = "controle"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(5).Items.Restrict("[Subject]='" & c00 & "'") c01 = c01 & "|" & it.body
Next5.3.2 Sent Emails: filter and move to another folder Sub emails_verzonden_filter_move()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") For Each it In .GetDefaultFolder(5).Items.Restrict("[Subject]='" & c00 & "'")
End Withit.Move .GetDefaultFolder(3)
Next5.3.3a Sent emails: delete using a loop Sub email_verzonden_delete()
For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(5).Items
End SubIf it.subject = "controle" Then it.Delete
Next5.3.3 Sent Emails: filter and delete Sub emails_verzonden_filter_delete()
c00 = "controle"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(5).Items.Restrict("[Subject]='" & c00 & "'") it.Delete
Next5.3.4 Sent Emails: filter and adapt Sub emails_verzonden_filter_adapt()
c00 = "controle"
End Subc01 = "new subject" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(5).Items.Restrict("[Subject]='" & c00 & "'") With it
Next
End With.subject = c01
End With.Save 5.4.1 Sent Emails: find and read Sub emails_verzonden_find_read()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(5).Items c01 = .Find("[Subject]='" & c00 & "'").body
End WithDo Until Err.Number <>0 c01 = c01 & "|" & .FindNext.body
Loop5.4.2 Sent Emails: find and move to another folder Sub emails_verzonden_find_move()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(5).Items.Find("[Subject]='" & c00 & "'").Move .GetDefaultFolder(3)
End WithDo Until Err.Number <>0 .GetDefaultFolder(5).Items.FindNext.Move .GetDefaultFolder(3)
Loop5.4.3 Sent Emails: find and delete Sub emails_verzonden_find_delete()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(5).Items .Find("[Subject]='" & c00 & "'").Delete
End WithDo Until Err.Number <>0 .FindNext.Delete
Loop5.4.4 Sent Emails: find and adapt Sub emails_verzonden_find_adapt()
On Error Resume Next
End Subc00 = "controle" c01 = "new subject" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(5).Items With .Find("[Subject]='" & c00 & "'")
End With.subject = c01
End With.Save Do Until Err.Number <>0 With .FindNext
Loop.subject = c01
End With.Save Sub email_ontvangen_read()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00) c01 = .To & " " & .subject & " " & .body
End With6.2.2 Received email move to another folder Sub email_ontvangen_move()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(6).Items(c00).Move .GetDefaultFolder(3)
End WithSub email_ontvangen_delete()
c00 = "controle"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00).Delete Sub email_ontvangen_adapt()
c00 = "controle"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00).subject = "new subject" 6.3.1 Received Emails: filter and read Sub emails_ontvangen_filter_read()
c00 = "controle"
End SubFor Each it InWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict("[Subject]='" & c00 & "'") c01 = c01 & "|" & it.body
Next6.3.2 Received Emails: filter and move to another folder Sub emails_ontvangen_filter_move()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") For Each it In .GetDefaultFolder(6).Items.Restrict("[Subject]='" & c00 & "'")
End Withit.Move .GetDefaultFolder(3)
Next6.3.3 Received Emails: filter and delete Sub emails_ontvangen_filter_delete()
c00 = "controle"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict("[Subject]='" & c00 & "'") it.Delete
Next6.3.4 Received Emails: filter and adapt Sub emails_ontvangen_filter_adapt()
c00 = "controle"
End Subc01 = "new subject" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict("[Subject]='" & c00 & "'") With it
Next
End With.subject = c01
End With.Save 6.4.1 Received Emails: find and read Sub emails_ontvangen_find_read()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items c01 = .Find("[Subject]='" & c00 & "'").body
End WithDo Until Err.Number <>0 c01 = c01 & "|" & .FindNext.body
Loop6.4.2 Received Emails: find and move to another folder Sub emails_ontvangen_find_move()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(6).Items.Find("[Subject]='" & c00 & "'").Move .GetDefaultFolder(3)
End WithDo Until Err.Number <>0 .GetDefaultFolder(6).Items.FindNext.Move .GetDefaultFolder(3)
Loop6.4.3 Received Emails: find and delete Sub emails_ontvangen_find_delete()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items .Find("[Subject]='" & c00 & "'").Delete
End WithDo Until Err.Number <>0 .FindNext.Delete
Loop6.4.4 Received Emails: find and adapt Sub emails_ontvangen_find_adapt()
On Error Resume Next
End Subc00 = "controle" c01 = "new subject" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items With .Find("[Subject]='" & c00 & "'")
End With.subject = c01
End With.Save Do Until Err.Number <>0 With .FindNext
Loop.subject = c01 .Save End With 6.5.1 Save first email in PostIn Sub eerste_ontvangen_email_opslaan()
With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6)
End Sub.items(1).SaveAs "G:\OF\" & .items(1).subject & ".msg",3
End With.items(1).SaveAs "G:\OF\" & .items(1).subject & ".txt",0 6.5.2 Save all emails in PostIn Sub alle_ontvangen_email_opslaan()
With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6)
End SubFor Each it in .Items
End Withit.SaveAs "G:\" & it.subject & ".msg"
Next6.6.1 Save Attachments of the first email in PostIn Sub M_snb()
With CreateObject("outlook.application")
End SubFor Each it In .GetNamespace("Mapi").GetDefaultFolder(6).Items(0).Attachments
End Withit.SaveAsFile "G:\OF\" & it.Filename
Next6.6.2 Save all attachments of the emails in PostIn Sub M_snb()
With CreateObject("outlook.application")
End SubFor Each it In .GetNamespace("Mapi").GetDefaultFolder(6).Items
End WithFor Each it1 In it.attachments
Nextit1.SaveAsFile "G:\OF\" & it1.Filename
Next6.6.3 Save attachments of a specific email in the PostIn Sub M_snb()
c00="controle"
End SubWith CreateObject("outlook.application") For Each it In .GetNamespace("Mapi").GetDefaultFolder(6).Items(c00).Attachments
End Withit.SaveAsFile "G:\OF\" & it.Filename
NextSub M_snb()
With Application.GetNamespace("MAPI").GetDefaultFolder(6).Items(1).Reply
End Sub.Body = "dit is mijn antwoord"
End With.Send 6.7.2 Reply email to all recipients Sub M_snb()
With Application.GetNamespace("MAPI").GetDefaultFolder(6).Items(1).ReplyAll
End Sub.Body = "dit is mijn antwoord"
End With.Send Sub Contact_properties()
' CreateItem (olContactItem) ' CreateItem (2) ' GetDefaultFolder(olFolderContacts) ' GetDefaultFolder(10) ' GetDefaultfolder("Contacts") With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(1) c00 = .Account
End Withc01 = .Actions.count c02 = .Anniversary c03 = .Application c04 = .AssistantName c05 = .AssistantTelephoneNumber c06 = .Attachments.count c07 = .BillingInformation c08 = .Birthday c09 = .body c010 = .Business2TelephoneNumber c011 = .BusinessAddress c012 = .BusinessAddressCity c013 = .BusinessAddressCountry c014 = .BusinessAddressPostalCode c015 = .BusinessAddressPostOfficeBox c016 = .BusinessAddressState c017 = .BusinessAddressStreet c018 = .BusinessFaxNumber c019 = .BusinessHomePage c020 = .BusinessTelephoneNumber c021 = .CallbackTelephoneNumber C022 = .CarTelephoneNumber c023 = .Categories c024 = .children c025 = .Class c026 = .Companies c027 = .CompanyAndFullName c028 = .CompanyLastFirstNoSpace c029 = .CompanyLastFirstSpaceOnly c030 = .CompanyMainTelephoneNumber c031 = .CompanyName c032 = .ComputerNetworkName c033 = .ConversationIndex c034 = .ConversationTopic c035 = .CreationTime c036 = .CustomerID c037 = .Department c038 = .Email1Address c039 = .Email1AddressType c040 = .Email1DisplayName c041 = .Email1EntryID c042 = .Email2Address c043 = .Email2AddressType c044 = .Email2DisplayName c045 = .Email2EntryID c046 = .Email3Address c047 = .Email3AddressType c048 = .Email3DisplayName c049 = .Email3EntryID c050 = .entryId c051 = .FileAs c052 = .FirstName c053 = .FormDescription c054 = .FTPSite c055 = .FullName c056 = .FullNameAndCompany c057 = .Gender c058 = .GetInspector c059 = .GovernmentIDNumber c060 = .Hobby c061 = .Home2TelephoneNumber c062 = .HomeAddress c063 = .HomeAddressCity c064 = .HomeAddressCountry c065 = .HomeAddressPostalcode c066 = .HomeAddressPostOfficeBox c067 = .HomeAddressState c068 = .HomeAddressStreet c069 = .HomeFaxNumber c070 = .HomeTelephoneNumber c071 = .Importance c072 = .Initials c073 = .InternetFreeBusyAddress c074 = .ISDNNumber c075 = .JobTitle c076 = .Journal c077 = .Language c078 = .LastFirstAndSuffix c079 = .LastFirstNoSpace c080 = .LastFirstNoSpaceCompany c081 = .LastFirstSpaceOnly c082 = .LastFirstSpaceOnlyCompany c083 = .LastModificationTime c084 = .LastName c085 = .LastNameAndFirstName c086 = .Links.count c087 = .MailingAddress c088 = .MailingAddressCity c089 = .MailingAddressCountry c090 = .MailingAddressPostalCode c091 = .MailingAddressPostOfficeBox c092 = .MailingAddressState c093 = .MailingAddressStreet c094 = .ManagerName c095 = .MessageClass c096 = .MiddleName c097 = .Mileage c098 = .MobileTelephoneNumber c099 = .NetMeetingAlias c0100 = .NetMeetingServer c0101 = .NickName c0102 = .NoAging c0103 = .OfficeLocation c0104 = .OrganizationalIDNumber c0105 = .OtherAddress c0106 = .OtherAddressCity c0107 = .OtherAddressCountry c0108 = .OtherAddressPostalCode c0109 = .OtherAddressPostOfficeBox c0110 = .OtherAddressState c0111 = .OtherAddressStreet c0112 = .OtherFaxNumber c0113 = .OtherTelephoneNumber c0114 = .OutlookInternalVersion c0115 = .OutlookVersion c0116 = .PagerNumber c0117 = .Parent c0118 = .PersonalHomePage c0119 = .PrimaryTelephoneNumber c0120 = .Profession c0121 = .RadioTelephoneNumber c0122 = .ReferredBy c0123 = .Saved c0124 = .SelectedMailingAddress c0125 = .Sensitivity c0126 = .Session c0127 = .Size c0128 = .Spouse c0129 = .subject c0130 = .Suffix c0131 = .TelexNumber c0132 = .Title c0133 = .TTYTDDTelephoneNumber c0134 = .UnRead c0135 = .User1 c0136 = .User2 c0137 = .User3 c0138 = .User4 c0139 = .UserCertificate c0140 = .UserProperties.count c0141 = .WebPage c0142 = .YomiCompanyName c0143 = .YomiFirstName c0144 = .YomiLastName Sub Contact_new()
With CreateObject("Outlook.Application").CreateItem(2)
End Sub.FirstName = "first"
End With.LastName = "last" .Email1Address = "snb@forum.eu" .Save Sub Contact_read()
c00 = "Jeroen Spoert" ' = fullname
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00) c01 = .FullName & "|" & .Email1Address
End With7.2.5 Contact information save as file Sub Contact_opslaan_als()
c00 = "Jeroen Spoert"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00) .SaveAs "E:\" & .FullName & ".txt", 0
End With.SaveAs "E:\" & .FullName & ".rtf", 1 .SaveAs "E:\" & .FullName & ".oft", 2 .SaveAs "E:\" & .FullName & ".msg", 3 .SaveAs "E:\" & .FullName & ".vcf", 6 7.2.2 Contact move to another folder Sub Contact_move()
c00 = "Jeroen Spoert"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(10).Items(c00).Move .GetDefaultFolder(3)
End WithSub Contact_delete()
c00 = "Jeroen Spoert"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00).Delete Sub Contact_adapt()
c00 = "Jeroen Spoert"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00) .Email2Address = "Jeroen@planeet.eu"
End With.Save 7.3.1 Contacts filter and read Sub Contacts_filter_read()
c00 = "Jeroen Spoert"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items.Restrict("[Fullname]='" & c00 & "'") c01 = c01 & "|" & it.Email1Address
Next7.3.2 Contacts filter and move to another folder Sub Contacts_filter_move()
c00 = "Jeroen Spoert"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") For Each it In .GetDefaultFolder(10).Items.Restrict("[FullName]='" & c00 & "'")
End Withit.Move .GetDefaultFolder(3)
Next7.3.3 Contacts filter and delete Sub Contacts_filter_delete()
c00 = "Jeroen Spoert"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items.Restrict("[FullName]='" & c00 & "'") it.Delete
Next7.3.4 Contacts filter and adapt Sub Contacts_filter_adapt()
c00 = "Bedrijf1"
End Subc01 = "Bedrijf1 BV." For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items.Restrict("[CompanyName]='" & c00 & "'") With it
Next.CompanyName = c01
End With.Save Sub Contacts_find_read()
On Error Resume Next
End Subc00 = "Bedrijf1" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items c01 = .Find("[CompanyName]='" & c00 & "'").FullName
End WithDo Until Err.Number <>0 c01 = c01 & "|" & .FindNext.FullName
Loop7.4.2 Contacts find and move to another folder Sub Contacts_find_move()
On Error Resume Next
End Subc00 = "Bedrijf1" With CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(10).Items.Find("[CompanyName]='" & c00 & "'").Move .GetDefaultFolder(3)
End WithDo Until Err.Number <>0 .GetDefaultFolder(10).Items.FindNext.Move .GetDefaultFolder(3)
Loop7.4.3 Contacts find and delete Sub Contacts_find_delete()
On Error Resume Next
End Subc00 = "Bedrijf1" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items .Find("[CompanyName]='" & c00 & "'").Delete
End WithDo Until Err.Number <>0 .FindNext.Delete
LoopSub Contacts_find_adapt()
On Error Resume Next
End Subc00 = "Bedrijf1" c01 = "Bedrijf1 BV." With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items With .Find("[CompanyName]='" & c00 & "'")
End With.CompanyName = c01
End With.Save Do Until Err.Number <>0 With .FindNext
Loop.CompanyName = c01
End With.Save 8.0 Distributionlist properties Sub distributielijst_properties()
' CreateItem(olDistlistItem) ' CreateItem (7) ' GetDefaultFolder(olFolderContacts) ' GetDefaultFolder(10) c00 = "DL example" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00) c01 = .Actions.Count
End Withc02 = .Application c03 = .Attachments.Count c04 = .body c05 = .Categories c06 = .Class c07 = .Companies c08 = .ConversationIndex c09 = .ConversationTopic c010 = .DLName c011 = .entryId c012 = .FormDescription c013 = .GetInspector c014 = .Importance c015 = .LastModificationTime c016 = .links.Count c017 = .MemberCount c018 = .MessageClass c019 = .Mileage c020 = .OutlookInternalVersion c021 = .OutlookVersion c022 = .Parent c023 = .Saved c024 = .Sensitivity c025 = .Session c026 = .Size c027 = .subject c028 = .UnRead c029 = .UserProperties Sub distributielijst_new()
With CreateObject("Outlook.Application").CreateItem(7)
End Sub.DLName = "DL voorbeeld"
End With.Save Sub distributielijst_read()
c00 = "DL voorbeeld"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00) c01 = .DLName & "|" & .MemberCount
End With8.2.2 Distributionlist: move to another folder Sub distributielijst_move()
c00 = "DL voorbeeld"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(10).Items(c00).Move .GetDefaultFolder(3)
End With8.2.3 Distributionlist: delete Sub distributielijst_delete()
c00 = "DL voorbeeld"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00).Delete Sub distributielijst_adapt()
c00 = "DL voorbeeld"
End Subc01 = "DL 2e voorbeeld" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00) .DLName= c01
End With.Save 8.3.1 Distributionlists: filter and read Sub distributielijsten_filter_read()
c00 = "DL voorbeeld"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items.Restrict("[DLName]='" & c00 & "'") c01 = c01 & "|" & it.DLName & "_" & it.MemberCount
Next8.3.2 Distributionlists: filter and copy Sub distributielijsten_filter_kopiëren()
c00 = "DL voorbeeld"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items.Restrict("[DLName]='" & c00 & "'") it.Copy
Nextit.Move CreateObject("Outlook.Application").GetNamespace("MAPI").Folders(2).Folders("distributielijst") 8.3.2 Distributionlists: filter and move to another folder Sub distributielijsten_filter_move()
c00 = "DL voorbeeld"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items.Restrict("[DLName]='" & c00 & "'") it.Move CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(3)
Next8.3.3 Distributionlists: filter and delete Sub distributielijsten_filter_delete()
c00 = "DL voorbeeld"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items.Restrict("[DLName]='" & c00 & "'") it.Delete
Next8.3.4 Distributionlists: filter and adapt Sub distributielijsten_filter_adapt()
c00 = "DL voorbeeld"
End Subc01 = "Oude lijst" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items.Restrict("[DLName]='" & c00 & "'") With it
Next.body = c01
End With.Save 8.4.1 Distributionlists: find and read Sub distributielijsten_find_read()
On Error Resume Next
End Subc00 = "DL voorbeeld" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items c01 = .Find("[DLName]='" & c00 & "'").body
End WithDo Until Err.Number <>0 c01 = c01 & "|" & .FindNext.body
Loop8.4.2 Distributionlists: find and move to another folder Sub distributielijsten_find_move()
On Error Resume Next
End Subc00 = "DL voorbeeld" With CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(10).Items.Find("[DLName]='" & c00 & "'").Move .GetDefaultFolder(3)
End WithDo Until Err.Number <>0 .GetDefaultFolder(10).Items.FindNext.Move .GetDefaultFolder(3)
Loop8.4.3 Distributionlists: find and delete Sub distributielijsten_find_delete()
On Error Resume Next
End Subc00 = "DL voorbeeld" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items .Find("[DLName]='" & c00 & "'").Delete
End WithDo Until Err.Number <>0 .FindNext.Delete
Loop8.4.4 Distributionlists: find and adapt Sub distributielijsten_find_adapt()
On Error Resume Next
End Subc00 = "DL voorbeeld" c01 = "new subject" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items With .Find("[DLName]='" & c00 & "'")
End With.subject = c01
End With.Save Do Until Err.Number <>0 With .FindNext
Loop.subject = c01
End With.Save 8.5.1 Contact in distributionlist read Sub distributielijst_read()
c00 = "DL voorbeeld"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00) If .MemberCount >0 Then
End WithWith .GetMember(1)
End Ifc01=.Name & "_" & .address & "_" & .AddressEntry
End With8.5.2 Distributionlist: read all contacts Sub distributielijst_kontaktpersoon_read()
c00 = "DL voorbeeld"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00) For j = 1 To .MemberCount
End Withc01 = c01 & "|" & .GetMember(j).Name & "_" & .GetMember(j).Address & "_" & .GetMember(j).AddressEntry
Next8.5.3 Distributionlist: add contact Alleen bestaande Contacts kunnen aan een distributionlist worden toegevoegd.Sub distributielijst_adapt_kontaktpersoon_add()
c00 = "DL voorbeeld"
End Subc01 = "K. Franken" Set c02 = CreateObject("Outlook.Application").CreateItem(0).Recipients c02.Add c01 With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00) .AddMembers c02
End With.Save 8.5.4 Distributionlist: delete contact Sub distributielijst_adapt_kontaktpersoon_delete()
c00 = "DL voorbeeld"
End Subc01 = "K. Franken" Set c02 = CreateObject("Outlook.Application").CreateItem(0).Recipients c02.Add c01 With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00) .RemoveMembers c02
End With.Save 8.5.5 Distributionlist: delete Contact: alternative method Sub distributielijst_adapt_kontaktpersoon_delete2()
c00 = "DL voorbeeld"
End Subc01 = "anita@planeet.eu" With CreateObject("outlook.application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00) For j = 1 To .MemberCount
.SaveIf LCase(.GetMember(j).address) = LCase(c01) Then .RemoveMembers .GetMember(j)
NextEnd With 8.5.6 Distributionlists: filter and delete contact Sub distributielijsten_filter_adapt_kontaktpersoon_delete2()
c01 = "anita@planeet.eu"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items.Restrict("[Messageclass]='IPM.DistList'") Set c02 = CreateObject("Outlook.Application").CreateItem(0).Recipients
NextFor j = 1 To it.MemberCount If LCase(it.GetMember(j).address) = LCase(c01) Then c02.Add it.GetMember(j)
NextIf c02.Count >0 Then it.RemoveMembers c02
End Ifit.Save Sub note_properties()
' creatitem(5) ' createitem(olNoteItem) ' Getdefaultfolder (12) ' Getdefaultfolder(olFolderNotes) ' GetDefaultfolder("notes") With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(12).Items(1) c1 = .Application
End Withc2 = .body c3 = .Categories c4 = .Class c5 = .Color c6 = .CreationTime c7 = .EntryId c8 = .GetInspector c9 = .Height c10 = .LastModificationTime c11 = .Left c12 = .links.Count c13 = .MessageClass c14 = .Parent c15 = .Saved c16 = .Session c17 = .Size c18 = .subject c19 = .Top c20 = .Width Sub note_new()
With CreateObject("Outlook.Application").CreateItem(5)
End Sub.body = "controle" & vbLf & "kijk eens"
End With.Save Sub note_read()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(12).Items(c00) If .Class = 44 Then c01 = .body & "|" & .CreationTime
End With9.2.2 Note: move to another folder Sub note_move()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(12).Items(c00).Move .GetDefaultFolder(3)
End WithSub note_delete()
c00 = "controle"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(12).Items(c00).Delete Sub note_adapt()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(12).Items(c00) .body = "new subject"
End With.Top = .Top + 30 .Left = .Left + 40 .Height = 2 * .Height .Width = 2 * .Width .Color = 2 .Save Sub notes_filter_read()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(12).Items For Each it In .Restrict("[Subject]='" & c00 & "'")
End Withc01 = c01 & "|" & it.body
Next9.3.2 Notes: filter and move to another folder Sub notes_filter_move()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") For Each it In .GetDefaultFolder(12).Items.Restrict("[Subject]='" & c00 & "'")
End Withit.Move .GetDefaultFolder(3)
Next9.3.3 Notes: filter and delete Sub notes_filter_delete()
c00 = "controle"
End SubFor Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(12).Items.Restrict("[Subject]='" & c00 & "'") it.Delete
NextSub notes_filter_adapt()
c00 = "controle"
End Subc01 = "new subject" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(12).Items.Restrict("[Subject]='" & c00 & "'") With it
Next.body = c01
End With.Save Sub notes_find_read()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(12).Items c01 = .Find("[Subject]='" & c00 & "'").body
End WithDo Until Err.Number <>0 c01 = c01 & "|" & .FindNext.body
Loop9.4.2 Notes: find and move to another folder Sub notes_find_move()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(12).Items.Find("[Subject]='" & c00 & "'").Move .GetDefaultFolder(3)
End WithDo Until Err.Number <>0 .GetDefaultFolder(12).Items.FindNext.Move .GetDefaultFolder(3)
LoopSub notes_find_delete()
On Error Resume Next
End Subc00 = "controle" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(12).Items .Find("[Subject]='" & c00 & "'").Delete
End WithDo Until Err.Number <>0 .FindNext.Delete
LoopSub notes_find_adapt()
On Error Resume Next
End Subc00 = "controle" c01 = "new subject" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(12).Items With .Find("[Subject]='" & c00 & "'")
End With.body = c01
End With.Save Do Until Err.Number <>0 With .FindNext
Loop.body = c01
End With.Save Sub appointment_properties()
'Createitem(1) 'Createitem(olappointment) 'Getdefaultfolder(9) 'Getdefaultfolder(olCalendar) 'Getdefaultfolder("Agenda") With CreateObject("outlook.application").GetNamespace("MAPI").GetDefaultFolder(9).Items(1) c00 = .Actions.Count
End WithFor jj = 1 To c0 d0 = .Actions(jj).Name
Nextc01 = .Application c02 = .Attachments.Count c03 = .BillingInformation c04 = .body c05 = .Categories c06 = .Class c07 = .Companies c08 = .ContactNames.Count c09 = .ConversationIndex c010 = .ConversationTopic c011 = .CreationTime c012 = .Docposted c013 = .DocPrinted c014 = .DocRouted c015 = .DocSaved c016 = .Duration c017 = .End c018 = .entryId c019 = .FormDescription c020 = .GetInspector c021 = .Importance c022 = .LastModificationTime c023 = .links.Count c024 = .Location c025 = .MeetingStatus c024 = .MessageClass c025 = .Mileage c026 = .NoAging c027 = .OutlookInternalVersion c028 = .OutlookVersion c029 = .Parent c030 = .Recipients.Count For jj = 1 To c30 With .Recipients(jj)
Nextd01 = .Name
End Withd02 = .address d03 = .AddressEntry c031 = .Saved c032 = .Sensitivity c033 = .Session c034 = .Size c035 = .start c036 = .subject c037 = .Type c038 = .UnRead c039 = .UserProperties.Count Sub appointment_new()
With CreateObject("Outlook.Application").CreateItem(1)
End Sub.subject = "Annual Meeting"
End With.Start = DateValue("06-03-2019") + TimeValue("12:30") .Duration = 45 .Location = "Vergaderzaal C" .Save Sub appointment_read()
c00 = "Annual Meeting"
End Subc01=CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(9).Items(c00).location 10.2.2 Appointment: move to another folder Sub appointment_adapt()
c00 = "Annual Meeting"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(9).Items(c00).move ..GetDefaultFolder(9)
End WithSub appointment_adapt()
c00 = "Annual Meeting"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(9).Items(c00).delete Sub appointment_adapt()
c00 = "Annual Meeting"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(9).Items(c00) .start = DateAdd( "d", 4, .start) + DateAdd( "h", 2, .start)
End With.Save 10.3.1 Appointments: filter and read Sub appointments_filter_read()
c01="Sessie B"
End Subc00 = "[Location]='" & c01 & "'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(9).Items.Restrict(c00) c02 = c02 & "|" & it.Location & it.start
Next10.3.2 Appointments: filter and move to another folder Sub appointments_filter_move()
c01="Sessie B"
End Subc00 = "[Location]='" & c01 & "'" with CreateObject("Outlook.Application").GetNamespace("MAPI") For Each it In .GetDefaultFolder(9).Items.Restrict(c00)
End Withit.move .GetDefaultFolder(3)
Next10.3.3 Appointments: filter and delete Sub appointments_filter_delete()
c01="Sessie B"
End Subc00 = "[Location]='" & c01 & "'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(9).Items.Restrict(c00) it.Delete
Next10.3.4 Appointments: filter and adapt Sub appointments_filter_adapt()
c01="Sessie B"
End Subc02="Room 203" c00 = "[Location]='" & c01 & "'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(9).Items.Restrict(c00) it.Location = c02
Nextit.start = DateAdd( "d", 1, it.start) it.Save 10.4.1 Appointments: find and read Sub appointments_find_read()
On Error Resume Next
End Subc01 = "11-04-2011 9:00" c00 = "[Start]>='" & format(c01, "ddddd hh:mm") & "' And [Start]<='" & format(DateAdd( "d", 7, c01), "ddddd hh:mm") & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(9).Items c02 = .Find(c00).subject
End WithDo Until Err.Number >0 c02 = c02 & "|" & .FindNext.subject
Loop10.4.2 Appointments: find and move to another folder Sub appointments_find_move()
On Error Resume Next
End Subc01 = "Sessie B" c00 = "[Location]='" & c01 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(9).Items.Find(c00).Move .GetDefaultFolder(3)
End WithDo Until Err.Number >0 .GetDefaultFolder(9).Items.FindNext.Move .GetDefaultFolder(3)
Loop10.4.3 Appointments: find and delete Sub appointments_find_delete()
On Error Resume Next
End Subc01 = "Sessie B" c00 = "[Location]='" & c01 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(9).Items .Find(c00).Delete
End WithDo Until Err.Number >0 .FindNext.Delete
Loop10.4.4 Appointments: find and adapt Sub appointments_find_adapt()
On Error Resume Next
End Subc01 = "Sessie B" c02 = "vergaderzaal A" c00 = "[Location]='" & c01 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(9).Items With .Find(c00)
End With.Location = c02
End With.Save Do Until Err.Number <>0 With .FindNext
Loop.Location = c02
End With.Save 10.4.5 Appointment: find using several criteria
'.Start
'.Subject '.End '.Location '.timeformat ' find by .start ' find by .start and .subject ' find by .start, .subject and .location ' find by .start, .subject, .end and .location Sub appointment_find()
On Error Resume Next
End Subc01 = DateValue("06-05-2019") + TimeValue("12:30") c02 = "onderwerp" c03 = DateAdd("n", 45, c01) c04 = "Vergaderzaal C" c05 = "ddddd h:mm" c00 = "[Start] ='" & format(c01, c05) & "'" c00 = "[Start] ='" & format(c01, c05) & "' And [Subject]='" & c02 & "'" c00 = "[Start] ='" & format(c01, c05) & "' And [Subject]='" & c02 & "' And [Location]='" & c04 & "'" c00 = "[Start] ='" & format(c01, c05) & "' And [Subject]='" & c02 & "' And [End]='" & format(c03, c05) & "' And [Location]='" & c04 & "'" MsgBox CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(9).Items.Find(c00).start 11.0 Meeting request properties Sub meetingrequest_properties()
' CreateItem(1) ' Createitem(olAppointmentitem) ' Getdefaultfolder(9) ' Getdefaultfolder(olfolderCalendar) ' Getdefaultfolder("Agenda") c00 = "Annual meeting" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00) c00 = .Actions.Count
End WithFor jj = 1 To c0 d0 = .Actions(jj).Name
Nextc01 = .Application c02 = .Attachments.Count c03 = .AutoForwarded c04 = .BillingInformation c05 = .body c06 = .Categories c07 = .Class c08 = .Companies c09 = .ConversationIndex c010 = .ConversationTopic c011 = .CreationTime c012 = DeferredDeliveryTime c013 = DeleteAfterSubmit c014 = .entryId c015 = .ExpiryTime c016 = .FlagDueBy c017 = .FlagRequest c018 = .FlagStatus c019 = .FormDescription c020 = .GetInspector c021 = .Importance C022 = .LastModificationTime c023 = .links.Count c024 = .MessageClass c025 = .Mileage c026 = .NoAging c027 = .OriginatorDeliveryReportRequested c028 = .OutlookInternalVersion c029 = .OutlookVersion c030 = .Parent c031 = .ReceivedTime c032 = .Recipients.Count For jj = 1 To c32 With .Recipients(jj)
Nextd01 = .Name
End Withd02 = .address d03 = .AddressEntry c033 = .ReminderSet c034 = .ReminderTime c035 = .ReplyRecipients c036 = .Saved c037 = .SaveSentMessageFolder c038 = .SenderName c039 = .Sensitivity c040 = .Sent c041 = .SentOn c042 = .Session c043 = .Size c044 = .subject c045 = .Submitted c046 = .UnRead c047 = .UserProperties.Count Sub meeting request_new()
c00="Annual Meeting"
End Subc01 = "Zaal A" c02 = format(DateAdd( "d", 2, Date) + TimeValue("20:15"), "ddddd hh:mm") c03 = 55 c04 = "Jeroen Spoert" With CreateObject("Outlook.Application").CreateItem(1)
.subject = c00
End With.MeetingStatus = 1 .Location = c01 .start = c02 .Duration = c03 .Recipients.Add c04 .send Select the request by it's property .Subject Sub meeting request_read()
c00 = "Annual Meeting"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00) c01 = .subject & "_" & CreationTime & "_" & .body & "_" & .SenderName & "_" & .Class
End With11.2.2 Meeting request: move to another folder Sub meeting request_move()
c00 = "Annual Meeting"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(6).Items(c00).Move .GetDefaultFolder(3)
End With11.2.3 Meeting request: delete Sub meeting request_delete()
c00 = "Annual Meeting"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00).Delete 11.2.5 Meeting request: accept tentatively Sub meeting request_read_voorlopig_accepteren()
c00 = "Annual Meeting"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00).GetAssociatedAppointment(True).Respond 2 11.2.6 Meeting request: accept Sub meeting request_read_accepteren()
c00 = "Annual Meeting"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00).GetAssociatedAppointment(True).Respond 3 11.2.7 Meeting request: decline Sub meeting request_read_weigeren()
c00 = "Annual Meeting"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00).GetAssociatedAppointment(True).Respond 4 11.3.1 Meeting requests: filter and read Sub meeting requests_filter_read()
For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict("[MessageClass]='IPM.Schedule.Meeting.Request'")
End Subc01 = c01 & "|" & it.body
Next11.3.2 Meeting requests: filter and move to another folder Sub meeting requests_filter_move()
With CreateObject("Outlook.Application").GetNamespace("MAPI")
End SubFor Each it In .GetDefaultFolder(6).Items.Restrict("[Class]='53'")
End Withit.Move .GetDefaultFolder(3)
Next11.3.3 Meeting requests: filter and delete Sub meeting requests_filter_delete()
For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict("[Class]='53'")
End Subit.Delete
Next11.3.5 Meeting requests: filter and accept tentatively Sub meeting requests_filter_voorlopig_accepteren()
For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict("[Class]='53'")
End Subit.GetAssociatedAppointment(True).Respond 3
Next11.3.6 Meeting requests: filter and accept Sub meeting requests_filter_accepteren()
For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict("[MessageClass]='IPM.Schedule.Meeting.Request'")
End Subit.GetAssociatedAppointment(True).Respond 2
Next11.3.7 Meeting requests: filter and decline Sub meeting requests_filter_weigeren()
For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict("[Class]='53'")
End Subit.GetAssociatedAppointment(True).Respond 4
Next11.3.8 Meeting requests: filter and copy Sub meeting requests_filter_kopiëren()
For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict("[MessageClass]='IPM.Schedule.Meeting.Request'")
End Subit.Copy
Nextit.Move CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(3) 11.4.1 Meeting requests: find and read Sub meeting requests_find_read()
On Error Resume Next
End Subc01 = "IPM.Schedule.Meeting.Request" c02 = "Annual Meeting" c00 = "[MessageClass]='" & c01 & "' And [Subject]='" & c02 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items c01 = .Find(c00).body
End WithDo Until Err.Number <>0 c01 = c01 & "|" & .FindNext.body
Loop11.4.2 Meeting requests: find and move to another folder Sub meeting requests_find_move()
On Error Resume Next
End Subc01 = "IPM.Schedule.Meeting.Request" c02 = "Annual Meeting" c00 = "[MessageClass]='" & c01 & "' And [Subject]='" & c02 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(6).Items.Find(c00).Move .GetDefaultFolder(3)
End WithDo Until Err.Number <>0 .GetDefaultFolder(6).Items.FindNext.Move .GetDefaultFolder(3)
Loop11.4.3 Meeting requests: find and delete Sub meeting requests_find_delete()
On Error Resume Next
End Subc01 = "IPM.Schedule.Meeting.Request" c02 = "Annual Meeting" c00 = "[MessageClass]='" & c01 & "' And [Subject]='" & c02 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items .Find(c00).Delete
End WithDo Until Err.Number <>0 .FindNext.Delete
Loop11.4.5 Meeting requests: find and accept tentatively Sub meeting requests_find_voorlopig_accepteren()
On Error Resume Next
End Subc01 = "IPM.Schedule.Meeting.Request" c02 = "Annual Meeting" c00 = "[MessageClass]='" & c01 & "' And [Subject]='" & c02 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items .Find(c00).GetAssociatedAppointment(True).Respond 3
End WithDo Until Err.Number <>0 .FindNext.GetAssociatedAppointment(True).Respond 3
Loop11.4.6 Meeting requests: find and accept Sub meeting requests_find_accepteren()
On Error Resume Next
End Subc01 = "IPM.Schedule.Meeting.Request" c02 = "Annual Meeting" c00 = "[MessageClass]='" & c01 & "' And [Subject]='" & c02 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items .Find(c00).GetAssociatedAppointment(True).Respond 2
End WithDo Until Err.Number <>0 .FindNext.GetAssociatedAppointment(True).Respond 2
Loop11.4.7 Meeting requests: find and decline Sub meeting requests_find_weigeren()
On Error Resume Next
End Subc01 = "IPM.Schedule.Meeting.Request" c02 = "Annual Meeting" c00 = "[MessageClass]='" & c01 & "' And [Subject]='" & c02 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items .Find(c00).GetAssociatedAppointment(True).Respond 4
End WithDo Until Err.Number <>0 .FindNext.GetAssociatedAppointment(True).Respond 4
Loop11.4.8 Meeting requests: find and copy Sub meeting requests_find_kopiëren()
On Error Resume Next
End Subc01 = "IPM.Schedule.Meeting.Request" c02 = "Annual Meeting" c00 = "[MessageClass]='" & c01 & "' And [Subject]='" & c02 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items With .Find(c00)
End With.Copy
.Move CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(3)
End WithDo Until Err.Number <>0 With .FindNext
Loop.Copy
End With.Move CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(3) Sub task_properties()
'Createitem(3) 'Createitem(olTaskItem) 'Getdefaultfolder(13) 'Getdefaultfolder(olFolderTasks) 'Getdefaultfolder("Tasks") With CreateObject("Outlook.application").GetNamespace("MAPI").GetDefaultFolder(13).Items(1) c00 = .Actions.Count
End WithFor jj = 1 To c0 d0 = .Actions(jj).Name
Nextc01 = .ActualWork c02 = .Application c03 = .Attachments.Count c04 = .BillingInformation c05 = .body c06 = .CardData c07 = .Categories c08 = .Class c09 = .Companies c010 = .complete c011 = .ContactNames.Count c012 = .Contacts c0013 = .ConversationIndex c014 = .ConversationTopic c015 = .CreationTime c016 = .DateCompleted c017 = .DelegationState c018 = .Delegator c019 = .DueDate c020 = .entryId c021 = .FormDescription C022 = .GetInspector c023 = .Importance c024 = .IsRecurring c025 = .LastModificationTime c026 = .links.Count c027 = .MessageClass c028 = .Mileage c029 = .NoAging c030 = .Ordinal c031 = .OutlookInternalVersion c032 = .OutlookVersion c033 = .Owner c034 = .Ownership c035 = .Parent c036 = .PercentComplete c037 = .Recipients.Count c038 = .ReminderOverrideDefault c039 = .ReminderPlaySound c040 = .ReminderSet c041 = .ReminderSoundFile c042 = .ReminderTime c043 = .ResponseState c044 = .Role c045 = .Saved c046 = .SchedulePlusPriority c047 = .Sensitivity c048 = .Session c049 = .Size c050 = .StartDate c051 = .Status c052 = .StatusOnCompletionRecipients c053 = .StatusUpdateRecipients c054 = .subject c055 = .TeamTask c056 = .TotalWork c057 = .UnRead c058 = .UserProperties.Count Sub task_new()
With CreateObject("Outlook.Application").CreateItem(3)
End Subc00 = "controle"
End Withc01 = Date c02 = DateValue("04-05-2019") + TimeValue("08:00:00") .subject = c00 .StartDate = c01 .ReminderSet = True .ReminderTime =c02 .Save Sub task_read()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(13).Items(c00) c01=.startdate & "_" & .Subject & "_" & .Status
End With12.2.2 Task: move to another folder Sub task_move()
c00 = "controle"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(13).Items(c00).move .Getdefaultfolder(3)
End WithSub task_delete()
c00 = "controle"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(13).Items(c00).delete Sub task_adapt()
c00 = "controle"
End Subc01 = "New controle" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(13).Items(c00) .subject = c01
End With.Save 12.2.5 Task: find using several criteria Sub task_find_more_criteria()
c02 = DateValue("15-04-2011")
End Subc01 = "New controle" c00 = "[StartDate] ='" & format(c02, "ddddd") & "' And [Subject]='" & c01 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(13).Items If Not .Find(c00) Is Nothing Then c03 = .Find(c00).ReminderTime
End WithSub tasks_filter_read()
c01 = DateValue("11-04-2011")
End Subc00 = "[StartDate] ='" & format(c00, "ddddd") & "'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(13).Items.Restrict(c00) c02 = c02 & "|" & it.subject
Next12.3.2 Tasks: filter and move to another folder Sub tasks_filter_move()
c01 = DateValue("11-04-2019")
End Subc00 = "[StartDate] ='" & format(c00, "ddddd") & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI") For Each it In .GetDefaultFolder(13).Items.Restrict(c00)
end withit.move .GetDefaultFolder(3)
Next12.3.3 Tasks: filter and delete Sub tasks_filter_delete()
c01 = DateValue("11-04-2011")
End Subc00 = "[StartDate] ='" & format(c00, "ddddd") & "'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(13).Items.Restrict(c00) it.Delete
Next12.3.4 Tasks: filter and adapt Sub tasks_filter_adapt()
c01 = DateValue("11-04-2011")
End Subc00 = "[StartDate] ='" & format(c00, "ddddd") & "'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(13).Items.Restrict(c00) it.StartDate = DateAdd( "d", -4, it.StartDate)
Nextit.Save Sub tasks_find_read()
On Error Resume Next
End Subc01 = DateValue("11-04-2011") c00 = "[StartDate] ='" & format(c00, "ddddd") & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(13).Items c02 = .Find(c00).Subject
End WithDo Until err.number<>0 c02 = c02 & "|" & .FindNext.Subject
Loop12.4.2 Tasks: find and move to another folder Sub tasks_find_move()
On Error Resume Next
End Subc01 = "New controle" c00 = "[Subject] ='" & c01 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(13).Items.Find(c00).move .GetDefaultFolder(3)
End WithDo Until err.number<>0 .GetDefaultFolder(13).Items.FindNext.move .GetDefaultFolder(3)
LoopSub tasks_find_delete()
On Error Resume Next
End Subc01 = "New controle" c00 = "[Subject] ='" & c01 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(13).Items .Find(c00).delete
End WithDo Until err.number<>0 .FindNext.delete
LoopSub tasks_find_adapt()
On Error Resume Next
End Subc01 = "New controle" c00 = "[Subject] ='" & c01 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(13).Items With .Find(c00)
End With.StartDate = DateAdd( "d", 4, .StartDate)
End With.Save Do Until err.number<>0 with .FindNext
Loop.StartDate = DateAdd( "d", 4, .StartDate)
End With.Save Sub taskrequest_properties()
'CreateItem(3) 'CreateItem(olTask) 'GetDefaultFolder(13) 'GetDefaultFolder(olFolderTasks) 'GetDefaultFolder("Tasks") With CreateObject("outlook.application").GetNamespace("MAPI").GetDefaultFolder(13).Items(1) c00 = .Actions.Count
End WithFor jj = 1 To c0 d0 = .Actions(jj).Name
Nextc01 = .Application c02 = .Attachments.Count c03 = .BillingInformation c04 = .body c05 = .Categories c06 = .Class c07 = .Companies c08 = .ConversationIndex c09 = .ConversationTopic c010 = .CreationTime c011 = .entryId c012 = .FormDescription c013 = .GetInspector c014 = .Importance c015 = .LastModificationTime c016 = .links.Count c017 = .MessageClass c018 = .Mileage c019 = .NoAging c020 = .OutlookInternalVersion c021 = .OutlookVersion C022 = .Parent c023 = .Saved c024 = .Sensitivity c025 = .Session c026 = .Size c027 = .subject c028 = .UnRead c029 = .UserProperties.Count Sub taskrequest_new()
c00 = "controle 7"
End Subc01 = Date +7" c02 = DateValue(""04-05-2019") + TimeValue("08:00:00" c03 = "snb@forums.eu" With CreateObject("Outlook.Application").CreateItem(3) .assign
End With.subject = c00 .StartDate = c01 .ReminderSet = True .ReminderTime = c02 .Recipients.Add c03 .send Sub taskrequest_read()
c00 = "Taskrequest: controle 7"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00) c01 = .subject & "_" & .CreationTime & "_" & .body & "_" & .Class & "_" & .MessageClass
End With13.2.2 Taskrequest: move to another folder Sub taskrequest_move()
c00 = "Taskrequest: controle 7"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(6).Items(c00).Move .GetDefaultFolder(3)
End WithSub taskrequest_delete()
c00 = "Taskrequest: controle 7"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00).Delete 13.2.5 Taskrequest: accept tentatively Sub taskrequest_read_simple_accepteren()
c00 = "Taskrequest: controle 7"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00).GetAssociatedTask(True).Respond 0, False, False Sub taskrequest_read_accepteren()
c00 = "Taskrequest: controle 7"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00).GetAssociatedTask(True).Respond 2, True, True Sub taskrequest_read_weigeren()
c00 = "Taskrequest: controle 7"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00).GetAssociatedTask(True).Respond 3, False, False 13.3.1 Taskrequests: filter and read Sub taskrequests_filter_read()
For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict("[MessageClass]='IPM.TaskRequest'")
End Subc01 = c01 & "|" & it.body
Next13.3.2 Taskrequests: filter and move to another folder Sub taskrequests_filter_move()
c01 = "IPM.TaskRequest"
End Subc00 = "[MessageClass]='" & c01 &'" With CreateObject("Outlook.Application").GetNamespace("MAPI") For Each it In .GetDefaultFolder(6).Items.Restrict(c00)
End Withit.Move .GetDefaultFolder(3)
Next13.3.3 Taskrequests: filter and delete Sub taskrequests_filter_delete()
c01 = "IPM.TaskRequest"
End Subc00 = "[MessageClass]='" & c01 &'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict(c00) it.Delete
Next13.3.4 Taskrequests: filter and adapt Sub taskrequests_filter_adapt()
c01 = "IPM.TaskRequest"
End Subc02 = "new subject" c00 = "[MessageClass]='" & c01 &'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict(c00) With it
Next.body = c02
End With.Save 13.3.5 Taskrequests: filter and accept tentatively Sub taskrequests_filter_voorlopig_accepteren()
c01 = "IPM.TaskRequest"
End Subc00 = "[MessageClass]='" & c01 &'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict(c00) it.GetAssociatedTask(True).Respond 0, False, False
Next13.3.6 Taskrequests: filter and accept Sub taskrequests_filter_accepteren()
c01 = "IPM.TaskRequest"
End Subc00 = "[MessageClass]='" & c01 &'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict(c00) it.GetAssociatedTask(True).Respond 2, False, False
Next13.3.7 Taskrequests: filter and decline Sub taskrequests_filter_weigeren()
c01 = "IPM.TaskRequest"
End Subc00 = "[MessageClass]='" & c01 &'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict(c00) it.GetAssociatedTask(True).Respond 3, False, False
Next13.3.8 Taskrequests: filter and copy Sub taskrequests_filter_kopiëren()
c01 = "IPM.TaskRequest"
End Subc00 = "[MessageClass]='" & c01 &'" With CreateObject("Outlook.Application").GetNamespace("MAPI") For Each it In .GetDefaultFolder(6).Items.Restrict(c00)
end withit.Copy
Nextit.Move .GetDefaultFolder(3) 13.4.1 Taskrequests: find and read Sub taskrequests_find_read()
On Error Resume Next
End Subc01 = "IPM.TaskRequest" c00 = "[MessageClass]='" & c01 &'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items c02 = .Find(c00).body
End WithDo Until Err.Number <>0 c02 = c02 & "|" & .FindNext.body
Loop13.4.2 Taskrequests: find and move to another folder Sub taskrequests_find_move()
On Error Resume Next
End Subc01 = "IPM.TaskRequest" c00 = "[MessageClass]='" & c01 &'" With CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(6).Items.Find(c00).Move .GetDefaultFolder(3)
End WithDo Until Err.Number <>0 .GetDefaultFolder(6).Items.FindNext.Move .GetDefaultFolder(3)
Loop13.4.3 Taskrequests: find and delete Sub taskrequests_find_delete()
On Error Resume Next
End Subc01 = "opdracht" c00 = "[ConversationTopic]='" & c01 &'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items .Find(c00).Delete
End WithDo Until Err.Number <>0 .FindNext.Delete
Loop13.4.4 Taskrequests: find and adapt Sub taskrequests_find_adapt()
On Error Resume Next
End Subc01 = "IPM.TaskRequest" c00 = "[MessageClass]='" & c01 &'" c02 = "New Subject" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(6).Items With .Find(c00)
End With.body = c02
End With.Save Do Until Err.Number <>0 With .FindNext
Loop.body = c02
End With.Save Sub journalitem_properties()
' CreateItem(4) ' CreateItem(olJournaItem) ' GetDefaultFolder(11) ' GetDefaultFolder(olFolderJournal) ' GetDefaultFolder("Journal") With CreateObject("outlook.application").GetNamespace("MAPI").GetDefaultFolder(11).Items(1) c00 = .Actions.Count
End WithFor jj = 1 To c00 d0 = .Actions(jj).Name
Nextc01 = .Application c02 = .Attachments.Count c03 = .BillingInformation c04 = .body c05 = .Categories c06 = .Class c07 = .Companies c08 = .ContactNames.Count c09 = .ConversationIndex c010 = .ConversationTopic c011 = .CreationTime c012 = .Docposted c013 = .DocPrinted c014 = .DocRouted c015 = .DocSaved c016 = .Duration c017 = .End c018 = .entryId c019 = .FormDescription c020 = .GetInspector c021 = .Importance C022 = .LastModificationTime c023 = .links.Count c024 = .MessageClass c025 = .Mileage c026 = .NoAging c027 = .OutlookInternalVersion c028 = .OutlookVersion c029 = .Parent c030 = .Recipients.Count For Each rp In .Recipients d01 = rp.Name
Nextd02 = rp.address d03 = rp.AddressEntry c031 = .Saved c032 = .Sensitivity c033 = .Session c034 = .Size c035 = .start c036 = .subject c037 = .Type .Type = "Letter"
c038 = .UnRead.Type = "Conversation" .Type = "Document" .Type = "E-mail Message" .Type = "Remote Session" .Type = "Fax" .Type = "Microsoft Access" .Type = "Microsoft Excel" .Type = "Microsoft Word" .Type = "Microsoft Powerpoint" .Type = "Note" .Type = "Phone Call" .Type = "Task" .Type = "Task Request" .Type = "Meeting" .Type = "Meeting Request" .Type = "Meeting Response" .Type = "Meeting Cancellation" c039 = .UserProperties.Count Sub journalitem_new()
c00 = Now
End Subc01 = 15 c02 = 4th journalitem c03 = "E-mail Message" With CreateObject("Outlook.Application").CreateItem(4) .start = format(c00, "ddddd hh:mm")
End With.Duration = c01 .subject = c02 .Type = c03 .Save Sub journalitem_read()
c00 = "4th journalitem"
End Subc01 = CreateObject("outlook.application").GetNamespace("MAPI").GetDefaultFolder(11).Items(c00).Type 14.2.2 Journalitem: move to another folder Sub journalitem_move()
c00 = "4e journalitem"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(11) .Items(c00).move .GetDefaultFolder(3)
End WithSub journalitem_delete()
c00 = "4e journalitem"
End SubCreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(11).Items(c00).Delete Sub journalitem_adapt()
c00 = "4e journalitem"
End Subc02 = "Meeting" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(11).Items(c00) .Type = c02
End With.Save 14.3.1 Journalitems: filter and read Sub journalitems_filter_read()
c01 = "Meeting"
End Subc00 = "[Type]='" & c01 & "'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(11).Items.Restrict(c00) c02 = c02 & "|" & it.subject
Next14.3.2 Journalitems: filter and move to another folder Sub journalitems_filter_move()
c01 = "Meeting"
End Subc00 = "[Type]='" & c01 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI") For Each it In .GetDefaultFolder(11).Items.Restrict(c00)
End Withit.move .GetDefaultFolder(3)
Next14.3.3 Journalitems: filter and delete Sub journalitems_filter_delete()
c01 = "Meeting"
End Subc00 = "[Type]='" & c01 & "'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(11).Items.Restrict(c00) it.Delete
Next14.3.4 Journalitems: filter and adapt Sub journalitems_filter_adapt()
c01 = "Meeting"
End Subc02 = "New tekst" c00 = "[Type]='" & c01 & "'" For Each it In CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(11).Items.Restrict(c00) it.subject = c02
Nextit.Save 14.4.1 Journalitems: find and read Sub journalitems_find_read()
On Error Resume Next
End Subc01 = "Meeting" c00 = "[Type]='" & c01 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(11).Items c02 = .Find(c00).Subject
End WithDo Until Err.Number<>0 c02 = c02 & "|" & .FindNext.Subject
Loop14.4.2 Journalitems: find and move to another folder Sub journalitems_find_move()
On Error Resume Next
End Subc01 = "Meeting" c00 = "[Type]='" & c01 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(11).Items.Find(c00).Move .GetDefaultFolder(3)
End WithDo Until Err.Number<>0 .GetDefaultFolder(11).Items.Find(c00).Move .GetDefaultFolder(3)
Loop14.4.3 Journalitems: find and delete Sub journalitems_find_delete()
On Error Resume Next
End Subc01 = "Meeting" c00 = "[Type]='" & c01 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(11).Items .Find(c00).Delete
End WithDo Until Err.Number <>0 .FindNext.Delete
Loop14.4.4 Journalitems: find and adapt Sub journalitems_find_adapt()
On Error Resume Next
End Subc01 = "Meeting" c02 = "new subject" c00 = "[Type]='" & c01 & "'" With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(11).Items With .Find(c00)
End With.Subject = c02
End With.Save Do Until err.number<>0 with .FindNext
Loop.Subject =c02
End With.Save Sub journalitem_find()
On Error Resume Next
End Subc01 = "Meeting" c00 = [Type] ='" & c01 & "'") c02 = CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(11).Items.Find(c00).subject Sub discussie_properties()
' CreateItem(6) ' CreateItem(olPost) With CreateObject("outlook.application").GetNamespace("MAPI").GetDefaultFolder(6).Items(1) c00 = .Actions.Count
End WithFor Each ac In .Actions d0 = ac.Name
Nextc01 = .Application c02 = .Attachments.Count c03 = .BillingInformation c04 = .body c05 = .Categories c06 = .Class c07 = .Companies c08 = .ConversationIndex c09 = .ConversationTopic c010 = .CreationTime c011 = .entryId c012 = .ExpiryTime c013 = .FormDescription c014 = .GetInspector c015 = .HTMLBody c016 = .Importance c017 = .LastModificationTime c018 = .links.Count c019 = .MessageClass c020 = .Mileage c021 = .NoAging C022 = .OutlookInternalVersion c023 = .OutlookVersion c024 = .Parent c025 = .ReceivedTime c026 = .Saved c027 = .SenderName c028 = .Sensitivity c029 = .SentOn c030 = .Session c031 = .Size c032 = .subject c033 = .UnRead c034 = .UserProperties.Count Sub discussie_new()
c00 = "New postmen"
End SubWith CreateObject("Outlook.application").CreateItem(6) .Subject = c00
End With.Save 15.1.1 New Post in specific folder Sub discussie_new_in_specifieke_map()
c00 = "New postmen"
End SubWith CreateObject("Outlook.application").CreateItem(6) .Subject = c00
End With.Save .Move .Application.GetNamespace("MAPI").GetDefaultFolder(16) Sub discussie_read()
c00 = "New postmen"
End Subc01 = CreateObject("Outlook.application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00).Class 15.2.2 Post: move to another folder Sub discussie_move()
c00 = "New postmen"
End SubWith CreateObject("Outlook.Application").GetNamespace("MAPI") .GetDefaultFolder(6).Items(c00).Move .GetDefaultFolder(16)
End WithSub discussie_delete()
c00 = "New postmen"
End SubCreateObject("Outlook.application").GetNamespace("MAPI").GetDefaultFolder(16).Items(c00).Delete Sub discussie_adapt()
c00 = "New postmen"
End Subc01 = "oud verhaal" With CreateObject("Outlook.application").GetNamespace("MAPI").GetDefaultFolder(6).Items(c00) .Subject = c01
End With.Save Sub posts_filter_read()
c01 = "New postmen"
End Subc00 ="[Subject]='" & c01 & "'" For Each it In CreateObject("Outlook.application").GetNamespace("MAPI").GetDefaultFolder(16).Items.Restrict(c00) c01 = c01 & "|" & it.SentOn
Next15.3.2 Posts: filter and move to another folder Sub posts_filter_move()
c00 = "New postmen"
End Subc00 ="[Subject]='" & c01 & "'" With CreateObject("Outlook.application").GetNamespace("MAPI") For Each it In .GetDefaultFolder(6).Items.Restrict(c00)
End Withit.Move .GetDefaultFolder(3)
Next15.3.3 Posts: filter and delete Sub posts_filter_delete()
c00 = "New postmen"
End Subc00 ="[Subject]='" & c01 & "'" For Each it In CreateObject("Outlook.application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Restrict(c00) it.Delete
Next15.3.4 Posts: filter and adapt Sub posts_filter_adapt()
c00 = "New postmen"
End Subc02 = "New themes" c00 ="[Subject]='" & c01 & "'" For Each it In CreateObject("Outlook.application").GetNamespace("MAPI").GetDefaultFolder(16).Items.Restrict(c00) it.Subject = c02
Nextit.Save Sub posts_find_read()
On Error Resume Next
End Subc01 = "New postmen" c00 ="[Subject]='" & c01 & "'" With CreateObject("Outlook.application").GetNamespace("MAPI").GetDefaultFolder(16).Items c02 = .Find(c00).Body
End WithDo Until Err.Number <>0 c02 = c02 & "|" & .FindNext.Body
Loop15.4.2 Posts: find and move to another folder Sub posts_find_move()
On Error Resume Next
End Subc01 = "New postmen" c00 ="[Subject]='" & c01 & "'" With CreateObject("Outlook.application").GetNamespace("MAPI") .GetDefaultFolder(16).Items.Find(c00).Move .GetDefaultFolder(6)
End WithDo Until Err.Number <>0 .GetDefaultFolder(16).Items.FindNext.Move .GetDefaultFolder(6)
LoopSub posts_find_delete()
On Error Resume Next
End Subc01 = "New postmen" c00 ="[Subject]='" & c01 & "'" With CreateObject("Outlook.application").GetNamespace("MAPI").GetDefaultFolder(16).Items .Find(c00).Delete
End WithDo Until Err.Number <>0 .FindNext.Delete
LoopSub posts_find_adapt()
On Error Resume Next
End Subc01 = "New postmen" c02 = "New themes" c00 ="[Subject]='" & c01 & "'" With CreateObject("Outlook.application").GetNamespace("MAPI").GetDefaultFolder(16).Items With .Find(c00)
End With.Subject = c02
End With.Save Do Until Err.Number <>0 With .FindNext
Loop.Subject = c02
End With.Save Sub discussie_find()
c01 = "New postmen"
End Subc00 ="[Subject]='" & c01 & "'" c01 = CreateObject("Outlook.application").GetNamespace("MAPI").GetDefaultFolder(6).Items.Find(c00).SentOn |