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.


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


The following procedures in this class have been grouped together and are described on a separate theme page

Page with its procedures DifferentFirstPageHeaderFooter, FirstPageTray, LinesPage, OddAndEvenPagesHeaderFooter, OtherPagesTray and TwoPagesOnOne


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.

ActiveDocument.PageSetup.BookFoldPrinting = True

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

ActiveDocument.PageSetup.BookFoldPrintingSheets =

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

ActiveDocument.PageSetup.BookFoldRevPrinting = True

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

ActiveDocument.PageSetup.BottomMargin =

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

ActiveDocument.PageSetup.CharsLine =

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

ActiveDocument.PageSetup.FooterDistance =

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

ActiveDocument.PageSetup.Gutter =

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

ActiveDocument.PageSetup.GutterPos = wdGutterPosLeft

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.

ActiveDocument.PageSetup.GutterStyle = wdGutterStyleBidi

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

ActiveDocument.PageSetup.HeaderDistance =

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

ActiveDocument.PageSetup.LayoutMode = wdLayoutModeDefault

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

ActiveDocument.PageSetup.LeftMargin =

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

ActiveDocument.PageSetup.LineNumbering =

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

ActiveDocument.PageSetup.MirrorMargins =

Orientation returns or sets the orientation of the page.

ActiveDocument.PageSetup.Orientation = wdOrientLandscape

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

ActiveDocument.PageSetup.PageHeight =

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

ActiveDocument.PageSetup.PageWidth =

PaperSize returns or sets the paper size.

ActiveDocument.PageSetup.PaperSize = wdPaper10x14

Parent returns an object that represents the parent object of the specified PageSetup object.

Dim objParent As Object
Set objParent = ActiveDocument.PageSetup.Parent

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

ActiveDocument.PageSetup.RightMargin =

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

ActiveDocument.PageSetup.SectionDirection = wdSectionDirectionLtr

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

ActiveDocument.PageSetup.SectionStart = wdSectionContinuous

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

ActiveDocument.PageSetup.ShowGrid = True

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

ActiveDocument.PageSetup.SuppressEndnotes =

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

ActiveDocument.PageSetup.TextColumns =

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

ActiveDocument.PageSetup.TopMargin =

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

ActiveDocument.PageSetup.VerticalAlignment = wdAlignVerticalBottom