XL97: Using the Common Dialog (Print) Control Flags PropertyLast reviewed: February 27, 1998Article ID: Q170698 |
The information in this article applies to:
SUMMARYThe Flags property for the CommonDialog control is used to return or set options in CommonDialog control dialog boxes. Most settings in the dialog boxes are related to a constant that can be used to set or return the value of the Flags property. This article contains an example that uses the Flags property to set and return several options in the CommonDialog control (in this case, the Print dialog box).
MORE INFORMATIONMicrosoft provides examples of Visual Basic for Applications procedures for illustration only, without warranty either expressed or implied, including, but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures in this article are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support engineers can help explain the functionality of a particular macro, they will not modify these examples to provide added functionality, nor will they help you construct macros to meet your specific needs. If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400.
The following steps assume you installed the ActiveX controls from the Microsoft Office 97 Office Developer Edition (ODE); the CommonDialog control is not installed when you install Microsoft Office 97.
Setting Options in the Print Dialog BoxTo use the Flags property to set options in the Print dialog box, follow these steps:
Returning User Options from the Print Dialog BoxTo continue the project in the previous section and return user options from the Print dialog box, follow these steps:
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.
REFERENCESFor more information about the Flag property, click the Index tab in Visual Basic for Applications Help, type the following text
flagsand then double-click the selected text to go to the "Flags Property (Print Dialog)" topic.
|
Additional query words: XL97
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |