Hi,
I am trying to set the default printer to automatically print to Landscape. I use a dll to set the parameters( dll available here www.g-productions.net )
When I walk through the debugger, it seems to be making the calls, but the setting stays at Potrait.
Is it possible that the Uidoc.print method is overriding the settings?
Please see code:
‘Declarations
Declare Function GetDefaultPrintername Lib “PrinterControl.dll”( ) As String
Declare Function SetOrientation Lib “PrinterControl.dll” (Byval mOrientation As Integer, Byval mType As Integer) As Boolean
Declare Function ReSetOrientation Lib “PrinterControl.dll”() As Boolean
Declare Function GetOrientation Lib “PrinterControl.dll” () As Integer
Declare Function GetPrinterList Lib “PrinterControl.dll” () As String
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
Dim oPrinter As Variant
Dim bSuccess As Integer
Set oPrinter = CreateObject("PrinterControl.CPrinter")
Call oPrinter.Getdefaultprintername 'Not really needed
Call oPrinter.GetOrientation
bSuccess = oPrinter.SetOrientation (2, 2) ' set landscape the first parameter indicates what kind of print format ( 1 for portrait and 2 for landscape )
' the second parameter indicates which method to use ( 0 for vb printer object, 1 for drivers, 2 for Win Default)
If bSuccess = True Then
%REM
Print what you have to print
%END REM
Call uidoc.Print
End If
Call oPrinter.ReSetOrientation
Set oPrinter = Nothing
End Sub