Printer Object
 
Syntax
 
Printer.Orientation = vsOrientation
 
Description
Returns or sets the paper orientation.
 
The default value for this property depends on the printer driver and the current printer settings.
 
This property relies on the printer driver, and may or may not be available on a particular printer. After setting this property, read it back to make sure the driver made the change, or check the Error property. If it is set to vperDeviceIncapable (7), then the printer does not support the selected setting and you should take appropriate action.
 
You can change the Orientation property while creating a document, so that some pages are rendered in landscape mode and others in portrait. To do this, you must switch the orientation before the page starts. For example, the following code creates a document with some text in portrait mode, then a chart in landscape mode, followed by more text in portrait mode:
 
Parameter
Description
vsOrientation
This parameter contains the following pre-defined constants and values:
Constant
Value
Description
orPortrait
0
Default. The document will be generated upright.
orLandScape
1
The document will be printed sideways.
 
 
See Also
Example
 
Sub Main
Dim i As Integer
 
With Printer
   'Printer object activeren in portrait mode:
   If Not .Init(,orPortrait) Then End
 
   'print some text in portrait mode
   For i = 1 To 10
      .Paragraph i & ": This is portrait mode."
   Next
 
   'print graphics in landscape mode
   .Orientation = orLandscape
   .NewPage
   .Paragraph "This is landscape mode."
   .BrushStyle = bsTransparent
   .DrawCircle .PageWidth / 2, .PageHeight / 2, .PageHeight / 4
 
   'print more text in portrait mode
   .Orientation = orPortrait
   .NewPage
   For i = 1 To 10
      .Paragraph i & ": This is portrait mode."
   Next
 
   'afdrukken gereed, object afsluiten
   .Submit
 
End With
 
End Sub