FilePageSetup

Syntax

FilePageSetup [.Tab = number] [, .TopMargin = number or text] [, .BottomMargin = number or text] [, .LeftMargin = number or text] [, .RightMargin = number or text] [, .Gutter = number or text] [, .PageWidth = number or text] [, .PageHeight = number or text] [, .Orientation = number] [, .FirstPage = number] [, .OtherPages = number] [, .VertAlign = number] [, .ApplyPropsTo = number] [, .Default] [, .FacingPages = number] [, .HeaderDistance = number or text] [, .FooterDistance = number or text] [, .SectionStart = number] [, .OddAndEvenPages = number] [, .DifferentFirstPage = number] [, .Endnotes = number] [, .LineNum = number] [, .StartingNum = number] [, .FromText = number or text] [, .CountBy = number] [, .NumMode = number]

Remarks

In Windows, sets page attributes such as margins and page width for the entire document or sections within the document. The arguments for the FilePageSetup statement correspond to the options in the Page Setup dialog box (File menu). On the Macintosh, use FileDocumentLayout.

Argument

Explanation

.Tab

Specifies which tab to select when you display the Page Setup dialog box with a Dialog or Dialog() instruction:

0 (zero) Margins

1 Paper Size

2 Paper Source

3 Layout

For details, see the second example in this entry.

.TopMargin

The distance between the top edge of the page and the top boundary of the body text in points or a text measurement

.BottomMargin

The distance between the bottom edge of the page and the bottom boundary of the body text in points or a text measurement

.LeftMargin

The distance between the left edge of the page and the left boundary of the body text in points or a text measurement


Argument

Explanation

.RightMargin

The distance between the right edge of the page and the right boundary of the body text in points or a text measurement

.Gutter

The extra margin space allowed for binding the document, in points or a text measurement

.PageWidth

The width of the page in points or a text measurement

.PageHeight

The height of the page in points or a text measurement

.Orientation

The orientation of the page:

0 (zero) Portrait

1 Landscape

Note that unlike using the TogglePortrait statement, specifying a new orientation with FilePageSetup does not automatically adjust the page size and margins for the new orientation.

.FirstPage, .OtherPages

Selects the paper source for the first page and the other pages in the document:

0 (zero) Default Tray (determined by the printer driver)

1 Upper Tray

2 Lower Tray

4 Manual Feed (often used to override the default tray for the first page)

5 Envelope

Other values may be available depending on your printer driver. To determine a value, record a macro that selects the option you want on the Paper Source tab in the Page Setup dialog box, and then review the values for .FirstPage and .OtherPages in the macro-editing window.

.VertAlign

Alignment of section on the page:

0 (zero) Top

1 Center

2 Justified

.ApplyPropsTo

The part of the document to apply the page setup properties to:

0 (zero) This Section

1 This Point Forward

2 Selected Sections

3 Selected Text

4 Whole Document

.Default

Makes the current page-setup properties the default for new documents based on the active template.


Argument

Explanation

.FacingPages

If 1, corresponds to selecting the Mirror Margins check box

.HeaderDistance

Distance of header from the top of the page

.FooterDistance

Distance of footer from the bottom of the page

.SectionStart

Determines the type of section break:

0 (zero) Continuous

1 New Column

2 New Page

3 Even Page

4 Odd Page

.OddAndEvenPages

If 1, corresponds to selecting the Different Odd And Even check box

.DifferentFirstPage

If 1, corresponds to selecting the Different First Page check box

.Endnotes

If 1, corresponds to selecting the Suppress Endnotes check box

.LineNum

If 1, corresponds to selecting the Add Line Numbering check box

.StartingNum

The number at which to begin line numbering

.FromText

The distance from text, in points or a text measurement; 0 (zero) sets automatic spacing

.CountBy

The numeric increment used to print line numbers.

.NumMode

Determines how lines are numbered:

0 (zero) Restart at each new page

1 Restart at each new section

2 Continuous


Examples

This Windows example sets the top margin to 1 inch for the entire document:


FilePageSetup .ApplyPropsTo = 4, .TopMargin = "1 in"

The following Windows example displays the Paper Source tab in the Page Setup dialog box, and then applies the settings the user selects:


Dim dlg As FilePageSetup
GetCurValues dlg
dlg.Tab = 2
Dialog dlg
FilePageSetup dlg

See Also

FileDocumentLayout, FileMacCustomPageSetupGX, FileMacPageSetup, FileMacPageSetupGX, FormatColumns, FormatSectionLayout