brkkrkmz112
New Member
- Joined
- Oct 24, 2016
- Messages
- 43
Hi everyone,
Im trying to open a outlook item through hyperlinks and saveas pdf file in a specific location. So far, I written something but can not achieve something works. Any help would be appreciated.
I get an error ""automation error library not registered"".
Im trying to open a outlook item through hyperlinks and saveas pdf file in a specific location. So far, I written something but can not achieve something works. Any help would be appreciated.
I get an error ""automation error library not registered"".
VBA Code:
Sub burak()
Dim outapp As Object
Dim foldername As String
Dim Msg As outlook.MailItem
Set outapp = CreateObject("Outlook.Application")
foldername = Selection.Hyperlinks(1).Address
foldername = ThisWorkbook.Path + "\" + foldername
Set Msg = outapp.Session.OpenSharedItem(foldername)
Msg.Display
Msg.SaveAs "C:\Users\Administrator\Desktop\Mail1\REFPDF" & "\" & foldername & ".pdf", olMSG
Msg.Close olDiscard
End Sub