'**************************************
' Name: Get_Printer_Orientation
' Description:Returns the current printe
'     r orientation
' By: Bil Becker
'
' Returns:integer
-1 = Error getting orientation
1 = portrait[vbPRORPortrait]
2 = landscape[vbPRORLandscape]
'
' Assumes:call this function and it retu
'     rns the current printer orientation
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/xq/ASP/txtCode
'     Id.975/lngWId.1/qx/vb/scripts/ShowCode.h
'     tm'for details.'**************************************



Function Get_Printer_Orientation() As Integer
    '---------------------------------------
    '     -------------------------------
    ' Name: Get_Printer_Orientation
    ' Author:Bil Becker
    ' Created: July 24,1998
    ' Modified: July 24,1998
    '
    ' Description: fuction to return the pri
    '     nter orientation.
    '
    ' Inputs:
    '
    ' Outputs: integer
    ' -1 = error getting orientation
    '1 = portrait[vbPRORPortrait]
    '2 = landscape[vbPRORLandscape]
    ' Changes:
    '---------------------------------------
    '     -------------------------------
    On Local Error Goto getprinterorientationerror


    With Printer
        Get_Printer_Orientation = .Orientation
    End With
    Exit Function
    getprinterorientationerror:
    Get_Printer_Orientation = -1
End Function
