Word 2007 Printer Selection and Tray Selection Bug

J

Jeremy

Hi,
I have a macro that:
(i) sets a specific printer as the active printer
(ii) sets the default tray for that printer.

The macro is below.

The macro worked fine in Word 2003. No changes need to be made to the syntax
etc to use it in Word 2007. If I run the macro there aren't any errors or
breaks, it runs fine.

However, the macro does not effect the changes it that it should. Once the
active printer has been set, the default tray is not set. For instance, if
originally the default tray is "Plain" and the macro instructs Word to set
the active printer and select "Tray 1" as the default tray, the active
printer is correctly set but the default tray does not change.

Oddly, if you break the process into two completely separate steps
everything works i.e. run code saying 'set active printer to X', then run
code saying 'set default tray to Plain' all is fine and you get the changes
you want; but not otherwise (not even if you spearate the steps into
different macros and use a third to 'call' the other two.

Can anyone shed light on this?


Sub PrintPlain()
ActivePrinter = "[JA LOCAL] HP 3rd Floor on NE02:"
Options.DefaultTray = "Plain"
End Sub
 

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