Displays the panels for editing the header and footer in a RichTextEdit control or hides the panels and returns to editing the main text.

Applies to

RichTextEdit controls and DataWindow controls with the RichTextEdit style


rtename.ShowHeadFoot ( editheadfoot {, headerfooter})




The name of the RichTextEdit or DataWindow control for which you want to edit header and footer information.


A boolean value specifying the editing panel to display. Values are:

  • TRUE -- Display the header and footer editing panels

  • FALSE -- Display the detail editing panel for the document body

headerfooter (optional)

A boolean value specifying whether the insertion point (caret) for editing the header/footer panel is in the header or the footer section. Values are:

  • True -- Caret is in the header section.

  • False -- Caret is in the footer section.

Return value


Returns 1 if it succeeds and -1 if an error occurs.


ShowHeadFoot takes effect when the control is in preview mode or when it is in edit mode for the main text. If the control is in preview mode, calling ShowHeadFoot returns to edit mode.

The headerfooter argument is ignored if the editheadfoot argument is false. The headerfooter argument defaults to "true" if a value is not provided. The header and footer can include input fields for page numbers and dates.

For a DataWindow control, ShowHeadFoot has no effect if the DataWindow object does not have the RichTextEdit presentation style.


This example displays the header and footer editing panels, allowing the user to specify the contents of the footer:

rte_1.ShowHeadFoot(TRUE, FALSE)

The following script inserts the current page number in the footer, then returns the focus to the body of the document in the rich text control:

rte_1.SetAlignment ( Center! )

See also