Results 1 to 1 of 1

Thread: Printing form with commondialog in landscape, NOT portrait

  1. #1

    Thread Starter
    Registered User jkw119's Avatar
    Join Date
    Oct 2001
    Location
    Pittsburgh
    Posts
    256

    Printing form with commondialog in landscape, NOT portrait

    I am trying to print a form, but do it in landscape. i have the following code...

    VB Code:
    1. Private Sub PRINTButton_Click()
    2. 10        DELETESUBButton.Visible = False
    3. 20        ADDSUBButton.Visible = False
    4. 30        DONEButton.Visible = False
    5. 40        DESIGNPropBlockButton.Visible = False
    6. 50        DESIGNSwithButton.Visible = False
    7. 60        BACKButton.Visible = False
    8. 70        PRINTButton.Visible = False
    9.  
    10.           Dim bCancel As Boolean
    11.           Dim nCopy As Integer
    12. 80        On Error GoTo ErrorHandler
    13. 90        bCancel = False
    14. 100       CommonDialog1.FLAGS = cdlPDHidePrintToFile Or _
    15.                                 cdlPDNoSelection Or _
    16.                                 cdlPDNoPageNums Or _
    17.                                 cdlPDCollate
    18. 110       CommonDialog1.CancelError = True
    19. 120       CommonDialog1.PrinterDefault = True
    20. 130       CommonDialog1.Copies = 1
    21. 140       CommonDialog1.ShowPrinter
    22. 150       If bcancel = False Then
    23. 160         For nCopy = 1 To CommonDialog1.Copies
    24. 170             frmPowerSystemDesign.PrintForm
    25. 180         Next nCopy
    26. 190       End If
    27.    
    28. 200       DoEvents
    29.    
    30. 210       DELETESUBButton.Visible = True
    31. 220       ADDSUBButton.Visible = True
    32. 230       DONEButton.Visible = True
    33. 240       DESIGNPropBlockButton.Visible = True
    34. 250       DESIGNSwithButton.Visible = True
    35. 260       PRINTButton.Visible = True
    36. 270       BACKButton.Visible = True
    37.  
    38. ErrorHandler:
    39. 280       If Err.Number = cdlCancel Then
    40. 290            bcancel = True
    41. 300            Resume Next
    42. 310       End If
    43.  
    44. End Sub

    It brings up the printer selection, but when you select landscape, it prints in portrait. does anyone know what is wrong....

    thanks,

    Jeff
    Last edited by jkw119; May 15th, 2002 at 09:07 AM.

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