ShowHeadFoot

Description

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 presentation style

Syntax

rtename.ShowHeadFoot ( editheadfoot, {headerfooter})

Argument

Description

rtename

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

editheadfoot

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.

Returns

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

Usage

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.

Examples

Example 1

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

rte_1.ShowHeadFoot(TRUE, FALSE)

Example 2

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.ShowHeadFoot(true,false)

rte_1.SetAlignment ( Center! )

rte_1.InputFieldInsert("PAGENO")

rte_1.ShowHeadFoot(false,false)

See also