Results 1 to 5 of 5

Thread: Printer ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    7
    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

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    try printer.orientation=vbPROPLandscape
    or
    printer.orientation=vbPRORPortrait

    I don't know if it'll work but it's worth a try


  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    7
    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

    ------------------------------------------------------------

  4. #4
    Junior Member
    Join Date
    Jun 1999
    Location
    St. Louis MO USA
    Posts
    18
    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

  5. #5
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    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
  •  



Click Here to Expand Forum to Full Width