편집

다음을 통해 공유


DoCmd.PrintOut method (Access)

The PrintOut method carries out the PrintOut action in Visual Basic.

Syntax

expression.PrintOut (PrintRange, PageFrom, PageTo, PrintQuality, Copies, CollateCopies)

expression A variable that represents a DoCmd object.

Parameters

Name Required/Optional Data type Description
PrintRange Optional AcPrintRange An AcPrintRange constant that specifies the range to print. The default value is acPrintAll.
PageFrom Optional Variant The first page to print. A numeric expression that's a valid page number in the active form or datasheet. This argument is required if you specify acPages for the PrintRange argument.
PageTo Optional Variant The last page to print. A numeric expression that's a valid page number in the active form or datasheet. This argument is required if you specify acPages for the PrintRange argument.
PrintQuality Optional AcPrintQuality An AcPrintQuality constant that specifies the print quality. The default value is acHigh.
Copies Optional Variant The number of copies to print. If you leave this argument blank, the default (1) is assumed.
CollateCopies Optional Variant Use True (1) to collate copies and False (0) to print without collating. If you leave this argument blank, the default (True) is assumed.

Remarks

Use the PrintOut action to print the active object in the open database. You can print datasheets, reports, forms, data access pages, and modules.

Example

The following example prints two collated copies of the first four pages of the active form or datasheet.

DoCmd.PrintOut acPages, 1, 4, , 2

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.