PrintOut Method

Applies To

DoCmd object.

Description

The PrintOut method carries out the PrintOut action in Visual Basic. For more information on how the action and its arguments work, see the action topic.

Syntax

DoCmd.PrintOut [printrange][, pagefrom, pageto][, printquality][, copies]
ú[, collatecopies]

The PrintOut method has the following arguments.

Argument

Description

printrange

One of the following intrinsic constants:

acPrintAll (default)
acSelection
acPages

If you leave this argument blank, the default constant (acPrintAll) is assumed.

pagefrom

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

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

One of the following intrinsic constants:

acDraft
acHigh (default)
acLow
acMedium

If you leave this argument blank, the default constant (acHigh) is assumed.

copies

A numeric expression. If you leave this argument blank, the default (1) is assumed.

collatecopies

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 leave an optional argument blank in the middle of the syntax, but you must include the argument's comma. If you leave one or more trailing arguments blank, don't use a comma following the last argument you specify.

See Also

DoCmd object, OpenForm method, OpenModule method, OpenQuery method, OpenReport method, OpenTable method, Print method, PrintOut action.

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