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 uses the following arguments.

Argument

Description

printrange

One of the following intrinsic constants:

acPrintAll

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

pagefrom

A numeric expression that is 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 is 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:

acHigh

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


Argument

Description

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

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


DoCmd.PrintOut acPages, 1, 4, , 2