Word Macro to print PDF
Posted on 2008-11-13
I need a macro to print an open document as a pdf and automatically put in the name of the output PDF to be the same as the incoming name.
It would also be good to be able to specify in the macro where the output PDF is going to be saved.
I tried to record one, but it hangs at the point where it asks what name to give it.
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
.UpdateFieldsAtPrint = False
.UpdateLinksAtPrint = False
.DefaultTray = "Use printer settings"
.PrintBackground = True
.PrintProperties = False
.PrintFieldCodes = False
.PrintComments = False
.PrintHiddenText = False
.PrintXMLTag = False
.PrintDrawingObjects = True
.PrintDraft = False
.PrintReverse = False
.MapPaperSize = False
.PrintOddPagesInAscendingOrder = False
.PrintEvenPagesInAscendingOrder = False
.PrintBackgrounds = False
.PrintPostScriptOverText = False
.PrintFormsData = False