I am attempting to save all of the mail items within a folder in Outlook as PDF.
Sub pdfConversion()
Dim outApp As Object, objOutlook As Object, objFolder As Object, myItems As Object, myItem As Object
Dim psName As String, pdfName As String
Set outApp = CreateObject("Outlook.Application")
Set objOutlook = outApp.GetNamespace("MAPI")
Set objFolder = objOutlook.GetDefaultFolder(olFolderInbox).Folders("PDF Conversion")
Set myItems = objFolder.Items
For Each myItem In myItems
myItem.PrintOut copies:=1, preview:=False, ActivePrinter:="Adobe PDF", printtofile:=True, _
collate:=True, prtofilename:="C:\Users\lturner\Documents\" & myItem.Subject & ".pdf"
Next myItem
End Sub
I am using Outlook 2007, which doesn't have the option to save mails as PDF, hence I'm attempting to use the .PrintOut
method.
Using the above I am currently receiving a "Named argument not found" error. I've looked elsewhere on the internet, but cannot seem to find a solution.