LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Excel-Printing to specific tray using macro

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.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for printing specific worksheet from a workbook splosczynski Excel Programming 0 June 6th 06 04:26 PM
Print with paper from a specific printer-tray [email protected] Excel Programming 5 October 29th 05 12:25 AM
How do I change the paper tray from an Excel macro / vba module? Jim Excel Programming 0 August 18th 05 05:51 PM
Printing worksheet with printer tray # 3 SHA Excel Programming 10 July 25th 04 06:27 PM
I can't quite get the syntax for printing to the manual feed tray Sharlene England Excel Programming 1 December 9th 03 07:42 PM


All times are GMT +1. The time now is 06:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"