Document linked to Printer in Microsoft Word
A: Not directly. What I've done instead is implement a floating toolbar button that is enabled and made visible by the documents going to the special printer. In my case, I use one printer just for envelopes so it is in my envelope templates.
The macro called by it collects the current printer setting in a variable, changes the printer to the envelope printer, prints the document, and then changes the printer setting back.
The macros and toolbar button are stored in a global template and called by the document template.
Print macro in global template:
Also in the global:
The envelope template has AutoNew and AutoOpen macros:
In the AutoExec macro for the global are the following:
Word.CommandBars("Envelope Toolbar").Enabled = False
Word.CommandBars("Envelope Toolbar").Visible = False
This keeps the toolbar from being in the way unless it is needed. I could hide it again when the document is closed but it's just as easy to click on the close box on the toolbar.
This way, I don't end up sending my letters to the envelope printer because the printer settings go back to what they were. Also, this way the bulk of the code is centrally located so if I change the printer I only need to change the code in one spot rather than in multiple envelope templates.
If needed, I suppose you could have the macro call up the print dialog instead of printing.
For more on global templates see: http://www.addbalance.com/usersguide/templates.htm
For instructions on inserting these macros in your documents or templates see: Macros and VBA
This page viewed times since 13 April 2004.
Many people visit this site and use the information it
Copyright 2000-2017 Charles Kyle Kenyon
FAQ provided as an adjunct / hobby as a part of my web site as a
criminal defense lawyer.