Headers and footers

Edit DOCX headers and footers in place, insert page fields, and use per-section first-page and even-page variants.

Headers and footers render in their Word page positions. Double-click the header or footer area to edit it in place.

Editing

Double-click inside the header or footer band to enter edit mode. From there, editing follows the same model as the document body: click to place the caret, drag to select, double- and triple-click for word and paragraph selection, right-click menus, hyperlinks, image selection, and table row, column, and edge resize all work identically. Undo and redo cover header and footer edits.

While editing, a separator bar labels the region (Header or Footer) and shows an Options menu:

  • Insert current page number inserts a PAGE field.
  • Insert total page count inserts a NUMPAGES field.
  • Insert section page count inserts a SECTIONPAGES field.
  • Remove header/footer clears the region.

Press Escape or click the close action to save and leave header/footer editing.

Page-number fields

PAGE, NUMPAGES, and SECTIONPAGES stay as Word fields. The page view updates their values when the document reflows.

PAGE shows the displayed page number. It honors the section start and format in w:pgNumType. NUMPAGES shows the document page count. SECTIONPAGES shows the page count for the current section.

A "Page X of Y" footer is the two inserts with literal text between them: type the text "Page ", insert the page number, type " of " with the surrounding spaces, insert the total page count.

A page-number field can carry a numeric picture switch. For example, PAGE \# 0# pads page 2 to 02.

The editor applies the picture to the computed header or footer value. A saved result does not replace that computed value. Pictures support digit placeholders, a grouping comma, and literal text.

Other fields use separate evaluation rules. See Fields and cross-references.

Legacy footers can store a centered PAGE field in an auto-sized w:framePr over an empty paragraph of the same style or a centered middle-dot decoration. Both paragraphs render in one footer band. Page values are re-centered per page, and the source structure survives save.

A supported fixed-width frame uses a page-relative X position and text-relative vertical centering over an empty anchor or a second PAGE paragraph. A leading tab can place its value outside the frame. The editor clips that value but retains all fields, paragraphs, and source ranges. Selections and pointer hits use the same clip rectangle.

This support covers a simple, single-line PAGE frame and a single-line empty or PAGE anchor. Values must fit completely inside the frame or lie completely beyond it. Partial wrapping, other positions, paragraph spacing, and additional content keep the ordinary flow behavior.

Per-section headers and footers

The OOXML model attaches header and footer references to sections, and the editor implements that model:

  • Each section can reference default, first, and even header and footer parts (w:headerReference / w:footerReference).
  • Different first page (w:titlePg) shows the first variant on a section's first page. Typical use: no header on a title page.
  • Different odd and even pages (w:evenAndOddHeaders) alternates default and even variants, as in book-style layouts.
  • Sections without their own references inherit from earlier sections, matching Word's "link to previous" behavior.
  • A page whose variant has no reference shows no header or footer, and its body starts at the page margin. A title page in a section that references only a default header is the common case.

Documents using any of these render and round-trip correctly; editing a header edits the specific part the page displays.

Watermarks

Word stores watermarks in header parts. The editor renders the supported unrotated legacy VML subset there. Rotated or curved watermark templates remain opaque.

Watermark insertion, editing, and headless authoring are not supported. The editor preserves the original VML or DrawingML markup and image payloads when you save.

Next steps

On this page