S
shabutt
Hello,
I have been using Mr. Mayor's following macro for word (I use word 2007)
which lets me print to any tray I specify in the macro and I have two macros
set up for two different trays.
Sub LaserTray1()
Dim sCurrentPrinter As String
Dim sTray As Integer
sCurrentPrinter = ActivePrinter
sTray = Options.DefaultTrayID
ActivePrinter = HP LaserJet P2015 Series PCL 5e
With Options
.DefaultTrayID = 259
End With
Application.PrintOut Filename:=""
With Options
.DefaultTrayID = sTray
End With
ActivePrinter = sCurrentPrinter
End Sub
I am unable to use the same code to run in excel 2007 which is obvious as
the above code is for word. Is it possible to modify the above code so it
works in excel too. Guide me please.
I have been using Mr. Mayor's following macro for word (I use word 2007)
which lets me print to any tray I specify in the macro and I have two macros
set up for two different trays.
Sub LaserTray1()
Dim sCurrentPrinter As String
Dim sTray As Integer
sCurrentPrinter = ActivePrinter
sTray = Options.DefaultTrayID
ActivePrinter = HP LaserJet P2015 Series PCL 5e
With Options
.DefaultTrayID = 259
End With
Application.PrintOut Filename:=""
With Options
.DefaultTrayID = sTray
End With
ActivePrinter = sCurrentPrinter
End Sub
I am unable to use the same code to run in excel 2007 which is obvious as
the above code is for word. Is it possible to modify the above code so it
works in excel too. Guide me please.