Leif wrote:Dunno if it is any help, but this is what I use to print to PDFCreator:
Thanks for code Leif.
It runs on my system when substitute "PrimoPDF" for "PDFCreator" (and in the process I learned that
PDFill PDF&Image Writer on NE06:!) but still I get the little pop-up dialog.
It runs on my system when substitute "PDFill PDF&Image Writer" for "PDFCreator"but this printer generates the regular File-save-As dialog, still requiring me to choose "OK for each file.
Then I realized that you had merely "Application.PrintOut" whereas I had "Application.PrintOut blah-blah-blah", so I did the unthinkable:
I read the help file, and waddyaknow:
Code: Select all
PrintToFile:=True, outputfilename:="b:\5331.pdf"
dispelled the dialog box.
So Thank You Leif!
Your response sent me off in the direction I could have followed from the start.
All I need do now is substitute a variable file name for the hard-coded and I am, as we say in the trade, up-and-running.
Code: Select all
Sub test()
Dim strActivePrinter As String
strActivePrinter = ActivePrinter
ActivePrinter = "PrimoPDF"
' ActivePrinter = "PDFill PDF&Image Writer"
Dim strFileName As String
strFileName = Format(Now(), "hhmmss")
Application.PrintOut FileName:=ThisDocument.FullName, Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=True, outputfilename:="b:\5331.pdf", PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
ActivePrinter = strActivePrinter
End Sub