|
-
Mar 16th, 2000, 03:37 AM
#1
Thread Starter
New Member
Can you programatically set the page orientation of the default printer ?
I have tried: printer.orientation = 2
BUT it always stays in the default port. mode
-
Mar 16th, 2000, 04:41 AM
#2
Frenzied Member
try printer.orientation=vbPROPLandscape
or
printer.orientation=vbPRORPortrait
I don't know if it'll work but it's worth a try
-
Mar 17th, 2000, 12:40 AM
#3
Thread Starter
New Member
I tried what you suggested but no luck.
Here's what my code within a pushbutton click event looks like now:
-code snip--------------------------------------------------
Printer.Orientation = vbProrLandScape ' Page to landscape
rptStock.Show ' Show report
------------------------------------------------------------
-
Mar 17th, 2000, 04:58 AM
#4
Junior Member
First you must set the default printer as printer then you may change the properties. Let me know if this doesn't work.
For Each xPrinter In Printers
If xPrinter.DeviceName = Printer.DeviceName Then
' Set printer as system default.
Set Printer = xPrinter
Printer.FontName = "Courier New"
Printer.FontSize = 11
Printer.PrintQuality = vbPRPQDraft
Printer.Orientation = vbPRORPortrait
'below shows user and programmer what the default printer is and what font is being used etc.
MsgBox "Printer.Orientation = " & Printer.Orientation & " Printer.fontname = " & Printer.FontName & " and printer.fontsize = " & Printer.FontSize & " Printer.DeviceName = " & Printer.DeviceName
' Stop looking for a printer.
Exit For
End If
Next
Hoped this helped
-
Mar 17th, 2000, 06:55 AM
#5
Setting the orientation of the printer object, is only usefull if you use the printer object to print.
rptStock.Show ' Show report
If you print from a report, the PrinterOrientation must probably be set in the report, and not in the printer object.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|