Class PageSetup (Word VBA)

The class PageSetup represents the page setup description. The PageSetup object contains all the page setup attributes of a document (such as left margin, bottom margin, and paper size) as properties.

The classes Document, Range, Section and Selection. give access to class PageSetup

To use a PageSetup class variable it first needs to be instantiated, for example

Dim psp as PageSetup
Set psp = ActiveDocument.PageSetup

The following procedures can be used to set variables of type PageSetup: Document.PageSetup, Range.PageSetup, Section.PageSetup, Sections.PageSetup and Selection.PageSetup.

Methods

SetAsTemplateDefault - Sets the specified page setup formatting as the default for the active document and all new documents based on the active template.

TogglePortrait - Switches between portrait and landscape page orientations for a document or section.

Properties

BookFoldPrinting true for Microsoft Word to print a document in a series of booklets so that the printed pages can be folded and read as a book.

BookFoldPrintingSheets returns or sets a Long which represents the number of pages for each booklet.

BookFoldRevPrinting true for Microsoft Word to reverse the printing order for book fold printing of bidirectional or Asian language documents.

BottomMargin returns or sets the distance (in points) between the bottom edge of the page and the bottom boundary of the body text.

CharsLine returns or sets the number of characters per line in the document grid.

DifferentFirstPageHeaderFooter true if a different header or footer is used on the first page. Can be True, False, or wdUndefined.

FirstPageTray returns or sets the paper tray to use for the first page of a document or section.

FooterDistance returns or sets the distance (in points) between the footer and the bottom of the page.

Gutter returns or sets the amount (in points) of extra margin space added to each page in a document or section for binding.

GutterPos returns or sets on which side the gutter appears in a document.

GutterStyle returns or sets whether Microsoft Word uses gutters for the current document based on a right-to-left language or a left-to-right language.

HeaderDistance returns or sets the distance (in points) between the header and the top of the page.

LayoutMode returns or sets the layout mode for the current document.

LeftMargin returns or sets the distance (in points) between the left edge of the page and the left boundary of the body text.

LineNumbering returns or sets a LineNumbering object that represents the line numbers for the specified PageSetup object.

LinesPage returns or sets the number of lines per page in the document grid.

MirrorMargins true if the inside and outside margins of facing pages are the same width.

OddAndEvenPagesHeaderFooter true if the specified PageSetup object has different headers and footers for odd-numbered and even-numbered pages.

Orientation returns or sets the orientation of the page.

OtherPagesTray returns or sets the paper tray to be used for all but the first page of a document or section.

PageHeight returns or sets the height of the page in points.

PageWidth returns or sets the width of the page in points.

PaperSize returns or sets the paper size.

RightMargin returns or sets the distance (in points) between the right edge of the page and the right boundary of the body text.

SectionDirection returns or sets the reading order and alignment for the specified sections.

SectionStart returns or sets the type of section break for the specified object.

ShowGrid true to display the page grid. False to hide it.

SuppressEndnotes true if endnotes are printed at the end of the next section that doesn't suppress endnotes.

TextColumns returns a TextColumns collection that represents the set of text columns for the specified PageSetup object.

TopMargin returns or sets the distance (in points) between the top edge of the page and the top boundary of the body text.

TwoPagesOnOne true if Microsoft Word prints the specified document two pages per sheet.

VerticalAlignment returns or sets the vertical alignment of text on each page in a document or section.

LineNumbering - Represents line numbers in the left margin or to the left of each newspaper-style column.

TextColumns -