PC Review


Reply
Thread Tools Rate Thread

I can't quite get the syntax for printing to the manual feed tray

 
 
Sharlene England
Guest
Posts: n/a
 
      9th Dec 2003
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 With Quote
 
 
 
 
Tom Ogilvy
Guest
Posts: n/a
 
      9th Dec 2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Laserjet 4, XP, envelope printed through manual tray, won't feed from tray afterwards PK Printers 0 21st Sep 2005 10:01 PM
HP Printer Manual Feed Tray Disappeared MicrosoftNews Microsoft Windows 2000 Printing 1 23rd Nov 2004 09:26 PM
Printing multiple files from the manual feed tray =?Utf-8?B?QmFyYiBSb3g=?= Microsoft Word Document Management 0 3rd Mar 2004 04:46 PM
HP 4050N - Won't pull from manual feed tray Clint Windows XP Print / Fax 1 10th Feb 2004 10:23 PM
How to print My report to the Manual Feed Tray, 3 times? Mita Microsoft Access Reports 0 15th Jan 2004 04:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:02 AM.