Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default I can't quite get the syntax for printing to the manual feed tray

Below is my code, and the escape sequence is correct as it does work in an
old wordperfect macro, but in excel this printout never goes to the correct
tray, any ideas?

Thanks.

ActiveSheet.PageSetup.PrintArea = "$A$1:$U$52"
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.45)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.73)
.BottomMargin = Application.InchesToPoints(0.4)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.43)
.PrintQuality = 600
End With

' selects the manual page tray without printing
SendKeys "{ESC}&l8H"
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default I can't quite get the syntax for printing to the manual feed tray

Send keys goes to the activewindow.

You would have to use low level file io to write to the printer.

Sub Macro5()
Dim ctrl as Long
Dim tmpstr as String
Open "LPT1:" For Output As #1
Print #1, "[Start of Printing Test]"
For ctrl = 1 To 10
tmpstr = "Printing ine " + Str(ctrl)
Print #1, tmpstr
Next
tmpstr = "[End of printing test]" + Chr(12)
Print #1, tmpstr
Close #1
End Sub


To a Network printer


First, I went to the immediate window in the VBE to query the activeprinter
string


? activePrinter
\\ARDAPS01\1D343E on Ne02:

then I used the first part in the below code:

Sub Macro5()
Dim ctrl As Long
Dim tmpstr As String
Open "\\ARDAPS01\1D343E" For Output As #1
Print #1, "[Start of Printing Test]"
For ctrl = 1 To 10
tmpstr = "Printing Line " + Str(ctrl)
Print #1, tmpstr
Next
tmpstr = "[End of printing test]" + Chr(12)
Print #1, tmpstr
Close #1
End Sub

Worked for me.

You would need to send you sequence to the printer.

All that said, I am not sure that will work if you then try to print through
windows using Printout. I believe that will go through the print driver and
send new settings (those selected in the print driver/print setup) to the
printer. However, it shouldn't be hard to test.



Regards,
Tom Ogilvy


"Sharlene England" wrote in message
...
Below is my code, and the escape sequence is correct as it does work in an
old wordperfect macro, but in excel this printout never goes to the

correct
tray, any ideas?

Thanks.

ActiveSheet.PageSetup.PrintArea = "$A$1:$U$52"
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.45)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.73)
.BottomMargin = Application.InchesToPoints(0.4)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.43)
.PrintQuality = 600
End With

' selects the manual page tray without printing
SendKeys "{ESC}&l8H"
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True





Reply
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
How do you set your printer to manual feed a worksheet during pri. Printing New Users to Excel 1 March 15th 10 03:44 PM
Default Paper Tray Thomas M Excel Discussion (Misc queries) 0 August 16th 06 07:48 AM
manual feed print options Trudy Excel Discussion (Misc queries) 2 March 9th 06 08:18 PM
Set Print to Manual Feed Janet[_3_] Excel Programming 0 August 28th 03 06:26 PM
Print all worksheets from same tray E Jackson Excel Programming 1 August 14th 03 03:56 AM


All times are GMT +1. The time now is 03:34 PM.

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

About Us

"It's about Microsoft Excel"