sartorius
asked on
PRINTER ORIENTATION ON DESKJET 600
How do I do to configure automatically my printer in landscape mode ?
I tried with "PRINTER.ORIENTATION=2" but it didn't work.
Help, please...
I tried with "PRINTER.ORIENTATION=2" but it didn't work.
Help, please...
ASKER
This line has an error:
Dim orient as orientstructure
"User-defined type not defined"
Miss a reference ?
Type OrientStructure
Orientation As Long
Pad As String * 16
End Type
For more complete :
http://support.microsoft.com/support/kb/articles/q80/1/85.asp
Orientation As Long
Pad As String * 16
End Type
For more complete :
http://support.microsoft.com/support/kb/articles/q80/1/85.asp
ASKER
This line has an error too :
x% = Escape(Printer.hDc, GETSETPAPERORIENT, Len(Orient), "", Null)
"RUNTIME ERROR : 48"
"FILE NOT FOUND : GDI"
Private Declare Function Escape Lib "gdi32" _
(ByVal hdc As Long, _
ByVal nEscape As Long, _
ByVal nCount As Long, _
ByVal lpInData As String, _
lpOutData As Any) _
As Long
(ByVal hdc As Long, _
ByVal nEscape As Long, _
ByVal nCount As Long, _
ByVal lpInData As String, _
lpOutData As Any) _
As Long
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Greate.
But, must be easier.
But, must be easier.
oh it is very easy. really. long texts makes easy life AND short texts make it harder. that's Drakinson 's 25 rule.
'add to the general declaration Area
Private Declare Function Escape% Lib "GDI" (ByVal hDC%, ByVal nEsc%, ByVal nLen%, lpData As Any, lpOut As Any)
Const PORTRAIT = 1
Const LANDSCAPE = 2
Const GETSETPAPERORIENT = 30
When you want to change, add the code:
Dim Orient As OrientStructure
Printer.Print ""
Orient.Orientation = LANDSCAPE
x% = Escape(Printer.hDC, GETSETPAPERORIENT, Len(Orient), "", Null)
Print x%