Class: PageSetupDialog in Category Windows : Common Dialogs from Total Visual SourceBook

Display the Page Setup Common Dialog using PageSetupDlgA in VB6 and VBA with 32 and 64-bit Windows API calls.

Procedure Name Type Description
(Declarations) Declarations Declarations and private variables for the CPageSetupDialog class.
Collate Property Determine whether collation is used when printing multiple copies.
Color Property Determine whether colors are printed on color printers.
Copies Property Get the number of copies to print.
DeviceName Property Get the name of the printer.
Paper Property Get the ID number for the paper size.
PaperSize Property Get the paper size.
Duplex Property Determine whether double sided printing is enabled for printers capable of supporting it.
Flags Property Get the flags used when displaying the Printer dialog.
hWndParent Property Get the handle to the parent window.
MarginBottom Property Get the size of the bottom margin.
MarginLeft Property Get the size of the left margin.
MarginMinBottom Property Get the minimum size of the bottom margin allowed for printing.
MarginMinLeft Property Get the minimum size of the left margin allowed for printing.
MarginMinRight Property Get the minimum size of the right margin allowed for printing.
MarginMinTop Property Get the minimum size of the top margin allowed for printing.
MarginRight Property Get the size of the right margin.
MarginTop Property Get the size of the top margin.
Orientation Property Get the print orientation.
PaperLength Property Get the length of the paper in tenths of a millimeter.
PaperWidth Property Get the width of the paper.
PrintQuality Property Get the print quality.
PrintScale Property Get the factor by which the printed output is scaled. The logical page size is scaled from the physical page size by a factor of PrintScale/100. For example, an 8.5 by 11 inch page with a PrintScale of 50 would contain as much data as a page of 17- by 22-inches because the output would be half the original height and width.
TTOption Property Get how true type fonts are printed.
YResolution Property Get the Y resolution of the printer.
Show Method Display the page setup common dialog.
' Example of CPageSetupDialog
'
' To use this example, create a new module and paste this code into it.
' Then run the procedure by putting the cursor in the procedure and pressing:
'    F5 to run it, or
'    F8 to step through it line-by-line (see the Debug menu for more options)

Private Sub Example_CPageSetupDialog()
  ' Comments: Examples of using the CPageSetupDialog class to select page settings from the Windows Common Control Page Setup Dialog in VB6 and VBA with 32 and 64 bit Windows API calls.
  '           See the Immediate Window for the selected settings.

  Dim clsPageSetupDialog As CPageSetupDialog

  Set clsPageSetupDialog = New CPageSetupDialog

  With clsPageSetupDialog
    ' Set flags as desired
    .Flags = PgsMargins

    ' Set orientation
    .Orientation = PgsLandscape

    ' Set paper
    .Paper = 12
    '.PaperSize = "A4"

    ' Show dialog and test if OK was selected
    If .Show() Then
      Debug.Print "Collate", .Collate
      Debug.Print "Copies", .Copies
      Debug.Print "DeviceName", .DeviceName
      Debug.Print "Duplex", .Duplex

      Debug.Print "Margin Bottom, Left, Right, Top", .MarginBottom, .MarginLeft, .MarginRight, .MarginTop
      Debug.Print "Margin Min Bottom, Left, Right, Top", .MarginMinBottom, .MarginMinLeft, .MarginMinRight, .MarginMinTop

      ' For orientation: Portrait is 1, Landscape is 2
      Debug.Print "Orientation", .Orientation, IIf(.Orientation = 1, "Portrait", "Landscape")

      Debug.Print "Paper Length, Width", .PaperLength, .PaperWidth

      Debug.Print "Print Quality", .PrintQuality
      Debug.Print "Print Scale", .PrintScale
      Debug.Print "Paper ID, Size", .Paper, .PaperSize
      Debug.Print
    End If
  End With

  Set clsPageSetupDialog = Nothing

End Sub

Total Visual SourceBook The source code in Total Visual Sourcebook includes modules and classes for Microsoft Access, Visual Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily add this professionally written, tested, and documented royalty-free code into your applications to simplify your application development efforts.

Total Visual SourceBook is written for the needs of a developer using a source code library covering the many challenges you face. Countless developers over the years have told us they learned some or much of their development skills and tricks from our code. You can too!

Additional Resources

Total Visual SourceBook CD and Printed Manual

Microsoft Access/ Office 2016, 2013, 2010, and 2007 Version
is Shipping!

New features in Total Visual SourceBook for Access, Office and VB6

Supports Access/Office 2016, 2013, 2010 and 2007, and Visual Basic 6.0!


View all FMS products for Microsoft Access All Our Microsoft Access Products

Reviews

Reader Choice Award for MS Access Source Code Library
Reader Choice

"The code is exactly how I would like to write code and the algorithms used are very efficient and well-documented."

Van T. Dinh, Microsoft MVP

SourceBook Info

Additional Info

Question

 

 

Free Product Catalog from FMS