Article ID: 170698
Article Last Modified on 11/23/2006
Private Sub CommandButton1_Click()
CommonDialog1.Flags = cdlPDDisablePrintToFile + cdlPDNoSelection
CommonDialog1.ShowPrinter
End Sub
Private Sub CommandButton1_Click()
CommonDialog1.ShowPrinter
' The statement "CommonDialog1.Flags And cdlPDPrintToFile" has a
' value of 0 when the Print To file check box is not selected and
' a value of 32 when it is selected.
MsgBox CommonDialog1.Flags And cdlPDPrintToFile
End Sub
Constant Value Description
----------------------------------------------------------------------
cdlPDAllPages &H0 Returns or sets the state of the All
Pages option button.
cdlPDCollate &H10 Returns or sets the state of the
Collate check box.
cdlPDDisablePrintToFile &H80000 Disables the Print To File check box.
cdlPDHelpButton &H800 Causes the dialog box to display the
Help button.
cdlPDHidePrintToFile &H100000 Hides the Print To File check box.
cdlPDNoPageNums &H8 Disables the Pages option button and
the associated edit control.
cdlPDNoSelection &H4 Disables the Selection option button.
cdlPDNoWarning &H80 Prevents a warning message from being
displayed when there is no default
printer.
cdlPDPageNums &H2 Returns or sets the state of the Pages
option button.
cdlPDPrintSetup &H40 Causes the system to display the Print
Setup dialog box rather than the Print
dialog box.
cdlPDPrintToFile &H20 Returns or sets the state of the Print
To File check box.
cdlPDReturnDC &H100 Returns a device context for the
printer selection made in the dialog
box. The device context is returned
in the dialog box's hDC property.
cdlPDReturnDefault &H400 Returns default printer name.
cdlPDReturnIC &H200 Returns an information context for the
printer selection made in the dialog
box. An information context provides a
fast way to get information about the
device without creating a device
context. The information context is
returned in the dialog box's hDC
property.
cdlPDSelection &H1 Returns or sets the state of the
Selection option button. If neither
cdlPDPageNums nor cdlPDSelection is
specified, the All option button is in
the selected state.
cdlPDUseDevModeCopies &H40000 If a printer driver doesn't support
multiple copies, setting this flag
disables the Number of copies spinner
control in the Print dialog. If a
driver does support multiple copies,
setting this flag indicates that the
dialog box stores the requested number
of copies in the Copies property.
flags
Additional query words: XL97
Keywords: kbdtacode kbhowto kbprogramming KB170698