• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1117
  • Last Modified:

Word VBA code no longer changes Printer Tray

For years we have been using VBA code such as:

      Options.DefaultTray = "Tray 2"

to change the printer tray so that users can print on different paper types. (The tray description varies from printer to printer, but the method is the same.)

This has worked on various printers (e.g. HP LaserJet 5, Dell 5100 colour), but not on a HP 4700 colour.

We have upgraded from MS Office 2000 / Windows 2000 to MS Office 2007 / Windows XP, and now none of the printers will change tray. If exactly the same code is sent to a printer from (1) Word 2000 / Win2k and (2) Word 2007 / XP, then (1) still works as before, but (2) does not. This suggests that the problem cannot be due to settings made on the printer's control panel, as these would apply in each case. In addition, the problem with the HP 4700 colour occurred before the upgrade to Word 2007 / XP, so if the problem is the same (as the symptoms are), it is difficult to see a common factor.

All printers are networked and the drivers / queues are assigned from a central print server running Windows 2003 server

Has anyone met this issue and found a solution?

I have also tried sending the tray's ID number instead of its text description, e.g.

      Options.DefaultTrayID = wdPrinterUpperBin

or changing the Tray settings in Page Setup for the active document, e.g.

      ActiveDocument.PageSetup.FirstPageTray = wdPrinterLowerBin

instead of changing the Default Tray. Neither of these approaches worked either.
0
PKFIOM
Asked:
PKFIOM
1 Solution
 
GrahamSkanCommented:
I don't have a multi-tray printer to try it, but Allen Wyatt's site is usually reliable and comprehensive. Here is his article on the subject, which he says applies to all versions from 97 to 2007.

http://word.tips.net/Pages/T001697_Specifying_a_Paper_Tray_in_a_Macro.html
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
I ran across this problem too and had to record a macro to ascertain the proper names by selecting the various paper trays.  The names had changed dramatically from the normal wdPrinterLowerBin to bin names such as "260."

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now