
VbNewLine & vbNewLine & "Save as pdf instead?", vbInformation + vbOKCancel) Response = MsgBox("Sorry, only saving in the pdf-format is supported." & _ StrCurrentFile = dlgSaveAs.SelectedItems(1) MsgFileName = Trim(oRegEx.Replace(msgFileName, ""))ĭlgSaveAs.InitialFileName = SpecialPath & "\" & msgFileName Set oRegEx = CreateObject("vbscript.regexp") SpecialPath = WshShell.SpecialFolders(16) Set WshShell = CreateObject("WScript.Shell") If InStr(1, fdf.Extensions, "pdf", vbTextCompare) > 0 Then Set dlgSaveAs = wrdApp.FileDialog(msoFileDialogSaveAs) Set wrdDoc = (FileName:=tmpFileName, Visible:=False, Format:=7) Set wrdApp = CreateObject("Word.Application")


Set wrdApp = GetObject(, "Word.Application") TmpFileName = tmpFileName & "\" & strName Set FSO = CreateObject("Scripting.FileSystemObject") Set MyOlNamespace = Application.GetNamespace("MAPI") VBA: Convert email to pdf Sub SaveAsPDFfile() Click Insert > Module, and paste below code to the Module script. Select one email, and press Alt + F11 keys to enable the Microsoft Visual Basic for Applications window.Ģ. If you are working at Outlook 2007 or 2010, you can apply a VBA code to convert one email to PDF file.ġ.

Note: This method only work in Outlook 2016. Now the selected message has been converted to a PDF file. Click Save, and click Cancel to stop printing. In the Save Print Output As dialog, select one path to place the file, and give it a name.ģ. Select the email you want to convert to PDF, click File > Print, select Microsoft Print to PDF from the Printer drop-down list, and click Print.Ģ. In Outlook, you can use the Print function to save one email as a PDF file.ġ. In Outlook, the Save As function only can save an email as HTML, TXT, MHT, MSG and Template format file, if you want to convert the email(s) to PDF file(s), how can you do? In this article, I introduce some tricks on solving this problem.Ĭonvert one email to PDF file with Print functionĬonvert batch emails to separated PDF files with Save as File utility How to batch convert multiple emails to pdf files in Outlook?
