hearthhrob4gals
Board Regular
- Joined
- Aug 20, 2014
- Messages
- 142
Hi,
i have saved almost 500 mail copies in a folder. the task is to open all the mail copies and save them as pdf. the below code loops through the folder. however, i need help so that i can save each mail item as pdf. help would be highly appreciated
i have saved almost 500 mail copies in a folder. the task is to open all the mail copies and save them as pdf. the below code loops through the folder. however, i need help so that i can save each mail item as pdf. help would be highly appreciated
Code:
Sub bla_OK()
Dim objOL As Object
Dim Msg As Object
Set objOL = CreateObject("Outlook.Application")
inPath = ActiveWorkbook.Path
thisFile = Dir(inPath & "\*.msg")
Do While thisFile <> ""
'Set Msg = objOL.CreateItemFromTemplate(thisFile)
Set Msg = objOL.Session.OpenSharedItem(inPath & "\" & thisFile)
' now use msg to get at the email parts
thisFile = Dir
Loop
Set objOL = Nothing
Set Msg = Nothing
End Sub