Tom Crowfoot
asked on
Word 2010 - print to specific printer
Dear Experts
I have a macro to print a word doc to PDF which is below. But the code changes the default printer but I am keen to keep the user's default printer as is. I am assuming that there are 2 ways to tackle this:
Option 1: modify the code below so it doesn't change the default printer
Option 2: record the details the of the default printer, then run this code & then set the default back again.
I'm easy on either method if they're both "good practice"
Can anybody help?
I have a macro to print a word doc to PDF which is below. But the code changes the default printer but I am keen to keep the user's default printer as is. I am assuming that there are 2 ways to tackle this:
Option 1: modify the code below so it doesn't change the default printer
Option 2: record the details the of the default printer, then run this code & then set the default back again.
I'm easy on either method if they're both "good practice"
Sub PDF()
' Print to PDF macro
ActivePrinter = "PDFCreator"
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _
PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
End Sub
Can anybody help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you need to print to a particular printer, you must make it the active printer. The printer is not an argument in the PrintOut method .
Swift acceptance too! Thank you.
ASKER