Link to home
Start Free TrialLog in
Avatar of PKFIOM
PKFIOM

asked on

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.
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

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
ASKER CERTIFIED SOLUTION
Avatar of Joanne M. Orzech
Joanne M. Orzech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial