Landscape printing: API issue

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

Subject: Landscape printing: API issue

DLL is now moved here → http://www.dgrigoriadis.net/post/2004/06/26/PrinterDLL-or-how-to-make-Lotus-Notes-to-print-in-landscape.aspx

Subject: RE: Landscape printing: API issue

Hi all

I’m interested in trying the above DLL. Unfortunately the download link on the provided page doesn’t work. I’ve tried contacting the developer of the source website but have received no response. What I’m hoping for is that someone out there in the Notes community has this DLL that can provide to me. Thanks!

Regards

Wayne

Subject: RE: Landscape printing: API issue

Found it here

http://www.dgrigoriadis.net/post/2004/06/26/PrinterDLL-or-how-to-make-Lotus-Notes-to-print-in-landscape.aspx

Subject: Landscape printing: API issue

I don’t know about the DLL, but I’ve simulated keypresses to set the print orientation. It’s not elegant and the same keypresses won’t work in different Notes versions, but it’s easy.

Use “SendKeys Library”

PushKeys “%FP+{TAB}{RIGHT}%A{ENTER}”