다음을 통해 공유


DoCmd.PrintOut Method (Access)

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

Syntax

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

A variable that represents a DoCmd object.

Parameters

Name

Required/Optional

Data Type

Description

PrintRange

선택

AcPrintRange

A AcPrintRange constant that specifies the range to print. The default value is acPrintAll.

PageFrom

선택

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

선택

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

선택

AcPrintQuality

A AcPrintQuality constant that specifies the print quality. the default value is acHigh.

Copies

선택

Variant

The number of copies to print. If you leave this argument blank, the default (1) is assumed.

CollateCopies

선택

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

You can 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

참고 항목

개념

DoCmd Object

DoCmd Object Members