Changing Printer Trays on Networked printers - Word 2003

G

Guest

This question has been discussed on numerous occassions and, at least up to
about six months ago, no one had been able to arrive at a solution. Thought
I would give it another try.

Here goes. Small office enviroment. Multiple computers and multiple
printers. Two printers, we'll call upstairs and downstairs are in question.
One is an HP4350, the other is an HP Laserjet 5. Upstairs uses tray codes of
262 and 261 for upper and lower trays. Downstairs uses codes
"wdPrinterUpperBin" and wdPrinterLowerBin."

A letter is printed to one or the other via a macro "Print_Letter."
Letterhead paper is kept in the top tray of each printer and plain white
paper is kept in the bottom. The macro/VBA Code does just fine selecting the
proper printer and printer port.

The way the code works (it worked for years with Windows 98 and XP and HP
4's and 5's) is that the all of the pages are first printed on the letterhead
paper, then the code inserts some ID information and a file copy of all the
pages is printed on plain paper.

All of this macro works fine with one exception. I can't seem to find a
reliable way to switch trays from the upper tray to the lower tray for the
file copy of the letter.

Using the page setup and changing the tray works fine from the console, but
if you record a macro and try to play it, it won't work. I've been through
about every combination of possible solutions, including changing the default
tray and trying to print to the default tray. Nothing seems to work.
Changing the FirstPage and OtherPage codes (eg. 261 and wdPrinterLowerBin)
seem to have no reliable effect, although on occassion one or both of the
printers will decide to print everything (both letter and copy) from the
upper or lower tray.

Does anyone have any suggestions?
 
J

Jonathan West

S.Hanagan said:
This question has been discussed on numerous occassions and, at least up
to
about six months ago, no one had been able to arrive at a solution.
Thought
I would give it another try.

Here goes. Small office enviroment. Multiple computers and multiple
printers. Two printers, we'll call upstairs and downstairs are in
question.
One is an HP4350, the other is an HP Laserjet 5. Upstairs uses tray codes
of
262 and 261 for upper and lower trays. Downstairs uses codes
"wdPrinterUpperBin" and wdPrinterLowerBin."

A letter is printed to one or the other via a macro "Print_Letter."
Letterhead paper is kept in the top tray of each printer and plain white
paper is kept in the bottom. The macro/VBA Code does just fine selecting
the
proper printer and printer port.

The way the code works (it worked for years with Windows 98 and XP and HP
4's and 5's) is that the all of the pages are first printed on the
letterhead
paper, then the code inserts some ID information and a file copy of all
the
pages is printed on plain paper.

All of this macro works fine with one exception. I can't seem to find a
reliable way to switch trays from the upper tray to the lower tray for the
file copy of the letter.

Using the page setup and changing the tray works fine from the console,
but
if you record a macro and try to play it, it won't work. I've been
through
about every combination of possible solutions, including changing the
default
tray and trying to print to the default tray. Nothing seems to work.
Changing the FirstPage and OtherPage codes (eg. 261 and wdPrinterLowerBin)
seem to have no reliable effect, although on occassion one or both of the
printers will decide to print everything (both letter and copy) from the
upper or lower tray.

Does anyone have any suggestions?

Take a look at this article

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


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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