Skip to main content

Page Setup Dialog in Rich Text Editor

  • 3 minutes to read

In the Page Setup dialog, end users can specify the document margins, orientation, paper size, layout and apply the changes to a whole document or an individual section.

Users can click the Page Setup dialog box launcher on the Page Layout ribbon tab to invoke this dialog. The ShowPageSetupFormCommand command execution invokes this dialog as well. Refer to the following topic for details on to add the ribbon ui for the RichEditControl: How to: Create the RichEditControl with a Ribbon UI.


All page settings are combined under the following tabs:


Options under the Margins tab enable users to set the margins and the orientation of the document pages.


The following API allows you to specify Margins options in code:

Option Description API Member
Margins (Top, Left, Bottom, Right) Specify page margins. Section.Margins
Gutter Adds a gutter margin - an extra space that ensures that binding will not obscure the text on printed pages. SectionMargins.Gutter
Gutter Position Allows you to position a gutter margin at page left or right. This gutter is applied to a specific section. SectionMargins.GutterPosition
Orientation Allows you to change the page orientation SectionPage.Landscape
Multiple Pages Specifies whether the margins are mirrored for multiple pages. Document.MarginType


The Paper tab includes options that allow users to specify paper size used in a document printout.


Option Description API Member
Paper Size Changes the paper size. SectionPage.PaperKind
Width Specifies the page width. SectionPage.Width
Height Specifies the page height. SectionPage.Height


Options on the Layout tab of the Page Setup dialog enable users to set when to start the current section and change the edit mode of headers and footers of a document.


Option Description API Member
Section start Specifies where the next section starts. Section.StartType
Suppress endnotes Suppresses endnotes for the current section. Available if endnotes are located at the end of each section. EndnoteOptions.Suppress
Different odd and even Enables different page settings for odd and even pages. Document.DifferentOddAndEvenPages
Different first page Enables different header and footer options for the first document page. Section.DifferentFirstPage
From edge Specify the distance between the header/footer and the top/bottom of the page. SectionMargins.FooterOffset

The Apply to option that is located on each tab of the Page Setup dialog allows users to specify whether the changes should be applied to the whole document or current section only.


Set the Document.Unit property to specify units of measure to be used in the Page Setup dialog.

To customize the default Page Setup dialog (modify captions, set default dialog values, implement custom validation, etc.) or substitute it with completely new dialog, handle the RichEditControl.PageSetupFormShowing event. To get an example of the dialog replacement, refer to the following articles:

See Also