printing to multiple printers with macro?

R

Ratedr

Is there a macro that I could write that could print a MS word file to
one printer, and then also print it to another printer . Both printers
are remote / network printers
 
D

Dave Lett

Hi,

You can probably use something like the following:

Dim sDefault As String
Dim sOtherPrint As String

sDefault = Application.ActivePrinter
sOtherPrint = "\\PRINTERS\WestBW on NE03:"

'''print the document with default printer
ActiveDocument.PrintOut
'''change the active printer
Application.ActivePrinter = sOtherPrint
'''print the document with the other printer
ActiveDocument.PrintOut

'''reset the defualt printer
Application.ActivePrinter = sDefault


HTH,
Dave
 
R

Ratedr

does this look right? it doesnt seem to be printing correctly
Dim sDefault As String
Dim sOtherPrint As String

sDefault = "\\UPSCOMP\UPS Thermal 2543"
sOtherPrint = "\\3MACHINECONTROL\UPS"

'''print the document with default printer
ActiveDocument.PrintOut
'''change the active printer
Application.ActivePrinter = sOtherPrint
'''print the document with the other printer
ActiveDocument.PrintOut

'''reset the defualt printer
Application.ActivePrinter = sDefault
 
D

Doug Robbins - Word MVP

See the following articles "Changing the selected (current) printer in Word
without changing the system default printer" at:

http://www.word.mvps.org/FAQs/MacrosVBA/ChangeCurPrinter.htm

Controlling the Printer from Word VBA
Part 1: Using VBA to Select the Paper Tray
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=101

Controlling the Printer from Word VBA
Part 2: Using VBA to control Duplex, Color Mode and Print Quality
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=116

Controlling the Printer from Word VBA
Part 3: Dealing with Different Paper Sizes
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=132

Controlling the Printer from Word VBA
Part 4: Getting printer driver details
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=183


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
R

Ratedr

I looked through those, and unless Im just missing it, I dont see how
to print to multiple printers, just to multiple trays, or to one
printer that isnt the default printer
 
G

Graham Mayor

Dave Lett's original reply covered the methodology of changing the active
printer. The syntax relating to the printer name is quite specific - I would
suggest recording a print to the alternative printer and copy the resulting
code to sOtherPrint. sDefault is the current active printer and this is
restored after printing the document.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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