User`s guide

Create Page Footers and Headers
13-131
Create Page Footers and Headers
In this section...
“Create Page Headers and Footers in a Template” on page 13-131
“Create Page Headers and Footers Programmatically” on page 13-133
You can create as many as three page headers and three page footers for a Word report
section:
One for the first page of the section
One for even pages
One for odd pages
You can create report page headers and footers programmatically or in the template used
to create a report or report part. You can append content to both template-defined and
programmatically defined headers and footers.
Create Page Headers and Footers in a Template
You can use Word to create page headers and footers in the main template of a report.
For information on creating headers and footers, see the Word documentation.
When you open a report, the DOM API:
1
Reads the headers and footers from the template and converts them to
DOCXPageHeader and DOCXPageFooter objects, respectively
2
Associates the headers and footer objects with the DOCXSection object that defines
the properties of the section that contains the headers and footers
3
Adds the headers and footers to your report as your code navigates the sections
defined by the template
As your report generation program navigates the sections, it can append content to the
template-defined headers and footers.
Access Template-Defined Headers and Footers
To append content to a template-defined header or footer, you need to access it. Use the
CurrentDOCXSection property of a Document or DocumentPart object to access the