Changing to landscape w/o EndDoc (yes I read the FAQ) 
Author Message
 Changing to landscape w/o EndDoc (yes I read the FAQ)

Can someone please help? I am trying to change the orientation of the
printer in the middle of a print job.  My problem is that to do this, I
seem to need to send a Printer.EndDoc to make it take effect.

I would like to be able to do this without sending an EndDoc because the
application is used to fax documents, and if there is an EndDoc, the fax
needs to be set up w/ the phone number again since it is a "new" print
job.  Also, when printing on a network, it caused extra print job
separators to be inserted whenever the orientation is changed.

Please help! Thanks...

Below is what appears in the MS VB Knowledge Base. I have also looked
through VB Tips, the MSDN CD's, and the FAQ for this newsgroup.

One thing to note -  if I change the Printer.EndDoc to Printer.NewPage
in the code below, the printer is _not_ reset.

   Type OrientStructure
      Orientation As Long
      Pad As String * 16
   End Type
   ' Enter the following Declare statement on one, single line:
   Declare Function Escape% Lib "GDI" (ByVal hDc%, ByVal nEsc%,
               ByVal nLen%, lpData As OrientStructure, lpOut As Any)

Add the following code to the Command1_Click event procedure of the
   Command1 button:

   Sub Command1_Click ()
      Const PORTRAIT = 1
      Const LANDSCAPE = 2

      Dim Orient As OrientStructure

      '* Start the printer
      Printer.Print ""

      '* Specify the orientation
      Orient.Orientation = LANDSCAPE

      '* Send escape sequence to change orientation
      x% = Escape(Printer.hDC, GETSETPAPERORIENT,

                Len(Orient), Orient, NULL)
      '* The EndDoc will now re-initialize the printer

      Printer.Print "Should print in landscape mode"
      Printer.EndDoc   <--- This is what kills me.....
   End Sub

Any help is appreciated.  If you don't mind e-mailing a response
that would be great, but I am obviously not going to mind if
you just post to this newsgroup instead........Thanks!

Pat Wheaton
Mt. View, CA                    

Tue, 28 Oct 1997 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. FE/BE split generates invalid operation, yes I read the help files :)

2. JET and dates - yes I do read the ng

3. change yes/no boolean field to another language in datagrid

4. PrtDevMode :: Change page layout to Landscape

5. problems with changing the orientation from landscape to portrait

6. changing print setup from porttrait to landscape using VB

7. Change printer from Portrait to Landscape ?

8. Changing print option to portrait/landscape

9. Changing Print option to Portrait/Landscape

10. Changing Print Option to Portrait/Landscape

11. Changing print option - portrait/landscape


Powered by phpBB® Forum Software