Guys,
I spent almost 3 hours to come up with the code below
I need to upload/post an HTML file to a public folder, so we can refer to it in emails with the following outlook path... outlook://Public Folders/All Public Folders/MCG/DTS Technical Contacts/~contact_list.html
However, the code below only post a new post item with the HTML file as attachment, and we cannot refer to it using the outlook path above.
Any help is appreciated!
...Alex
postToOutlookPublicFolders()
Function postToOutlookPublicFolders()
Set objOLK = CreateObject("Outlook.Application")
Set objNS = objOLK.Application.GetNamespace("MAPI")
Set objPF = objNS.Folders("Public Folders").Folders("All Public Folders").Folders("MCG").Folders("DTS Technical Contacts")
Set postItem = objPF.Items.Add("IPM.Post")
Set myAttachments = postItem.Attachments
myAttachments.Add "C:\Temp\contact_list.html", 1, 1, "Something"
postItem.Post
'objOLK.Quit
Set objOLK = Nothing
Set objNS = Nothing
Set objPF = Nothing
End Function
I spent almost 3 hours to come up with the code below
I need to upload/post an HTML file to a public folder, so we can refer to it in emails with the following outlook path... outlook://Public Folders/All Public Folders/MCG/DTS Technical Contacts/~contact_list.html
However, the code below only post a new post item with the HTML file as attachment, and we cannot refer to it using the outlook path above.
Any help is appreciated!
...Alex
postToOutlookPublicFolders()
Function postToOutlookPublicFolders()
Set objOLK = CreateObject("Outlook.Application")
Set objNS = objOLK.Application.GetNamespace("MAPI")
Set objPF = objNS.Folders("Public Folders").Folders("All Public Folders").Folders("MCG").Folders("DTS Technical Contacts")
Set postItem = objPF.Items.Add("IPM.Post")
Set myAttachments = postItem.Attachments
myAttachments.Add "C:\Temp\contact_list.html", 1, 1, "Something"
postItem.Post
'objOLK.Quit
Set objOLK = Nothing
Set objNS = Nothing
Set objPF = Nothing
End Function