Recognize default printer name from within Word

L

Legal Learning

Here is my existing code:
Sub Print_Letter
With Dialogs(wdDialogFilePrintSetup)
.Printer = "\\fs2\HP Color LaserJet 3500"
.DoNotSetAsSysDefault = True
.Execute
End With

Dialogs(wdDialogFilePrint).Show
End Sub


Let's say that the printer prior to running this macro is \\fs2\HP 4100

After this macro is executed Word will keep the 3500 as the printer until
the user changes it back. How can I assign a variable and change it back to
the printer it was before executing the macro (this may not be the default
either) AFTER the user clicks ok on the Print dialog?

Thanks in advance for any help!
 
J

Jezebel

Dim pPrinter as string

pPrinter = ActivePrinter

ActivePrinter = "\\fs2\HP Color LaserJet 3500"
ActiveDocument.PrintOut

ActivePrinter = pPrinter
 
L

Legal Learning

Thanks Jezebel. However, I do not want to print it out. I want to show the
print dialog window so that they can print more than one copy or current
page. After the Print Dialog is displayed and they make their choices in
copies or whatever and click ok is when I want it to go back to the printer.
And, if I use ActivePrinter then it changes the default printer. I don't
want to do that either.
 
J

Jezebel

Use the same method --- make a note of the active printer, call the dialog,
reset the active printer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top