Selecting trays in Microsoft Office using VBA / Macros

I recently got a task from a customer wishing to “control” the trays using page defaults in word.

Unfortunatly this selection changes everytime you change your printer, therefore i made this little VBA code for him.

 

Sub trayselector()
' Selection of the tray numbers are as follow
' Xerox selections Tray 1 = 260, Tray 2 = 259, Tray 3 = 258, Tray 4 = 257 etc.
' Canon Selections Tray 1 = 1, Tray 2 = 3, Tray 3 =
 
With ActiveDocument.PageSetup
.FirstPageTray = 260 'wdPrinterManual
.OtherPagesTray = 259 'wdPrinterManualFeed
End With
End SubThis way he can just press this macro before he print, and make sure the right trays is selected.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2024: Noervig's notes | Easy Theme by: D5 Creation | Powered by: WordPress