Hi, i took this code off the net and adjusted to my needs. It prints emails to pdf fine, just that it does not include the header of the email (the From, To, Subject part). Can anyone help me with this? also, how do i specify the folder the pdfs are saved to? attached code for reference
VBA Code:
Sub printpdf()
Dim objDoc, objInspector, myItem, Automation As Object
Dim outApp As Object, objOutlook As Object, objFolder 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("Automation")
Set myItems = objFolder.Items
For Each myItem In myItems
Filename = Replace(myItem.Subject, ":", "")
Set objInspector = myItem.GetInspector
Set objDoc = objInspector.WordEditor
objDoc.ExportAsFixedFormat folderPath & Filename & ".pdf", 17
Set objInspector = Nothing
Set objDoc = Nothing
Next myItem
End Sub