FilePrint

Syntax

FilePrint [.Background = number] [, .AppendPrFile = number] [, .Range = number] [, .PrToFileName = text] [, .From = text] [, .To = text] [, .Type = number] [, .NumCopies = number] [, .Pages = text] [.Order = number] [, .PrintToFile = number] [, .Collate = number] [, .FileName = text] [, .OutputPrinter = text]

Remarks

Prints all or part of the active document or a document you specify. The arguments for the FilePrint statement correspond to the options in the Print dialog box (File menu).

Argument

Explanation

.Background

If 1, the macro continues while Word prints the document. On the Macintosh, this argument is not available and generates an error.

.AppendPrFile

If you print to a file, specifies whether to overwrite or append to the file if it already exists:

0 (zero) Overwrite

1 Append

On the Macintosh, this argument is ignored unless QuickDraw GX is installed.

.Range

The page range:

0 (zero) Prints the entire document

1 Prints the selection

2 Prints the current page

3 Prints the range of pages specified by .From and .To

4 Prints the range of pages specified by .Pages

.PrToFileName

If you print to a file, the path and filename of the file to print to. This argument is not available on the Macintosh unless QuickDraw GX is installed.

.From

The starting page number when .Range is 3

.To

The ending page number when .Range is 3

.Type

The item to print:

0 (zero) Document

1 Summary Info

2 Annotations

3 Styles

4 AutoText Entries

5 Key Assignments


Argument

Explanation

.NumCopies

The number of copies to print

.Pages

The page numbers and page ranges you want to print, separated by commas. For example, "2, 6-10" prints page 2 and pages 6 through 10.

.Order

Further delimits the range of pages to print:

0 (zero) Prints all pages in the range.

1 Prints only odd pages in the range.

2 Prints only even pages in the range.

.PrintToFile

If 1, sends printer instructions to a file. Make sure to specify a filename with .PrToFileName. This argument is not available on the Macintosh unless QuickDraw GX is installed.

.Collate

If 1, organizes pages when printing multiple copies of the document.

.FileName

The path and filename of the document to print. If omitted, Word prints the active document.

.OutputPrinter

On the Macintosh, if QuickDraw GX is installed, specifies the printer to print to. If the specified printer is not valid, Word prints to the printer selected in the Print dialog box or to the default desktop printer.


See Also

FilePrintDefault, FilePrintOneCopy, FilePrintSetup, ToolsOptionsPrint