Exists Property
Applies To
HeaderFooter object.
Description
True if the specified HeaderFooter object exists. Read/write Boolean.
Note The primary header and footer exist in all new documents by default. Use this method to determine whether a first-page or odd-page header or footer exists. You can also use the DifferentFirstPageHeaderFooter or OddAndEvenPagesHeaderFooter property to return or set the number of headers and footers in the specified document or section.
See Also
DifferentFirstPageHeaderFooter property, Empty property, Footers property, Headers property, OddAndEvenPagesHeaderFooter property, ShowBookmarks property.
Example
If a first-page header exists in section one, this example sets the text for the header.
Set aSection = ActiveDocument.Sections(1)
If aSection.Headers(wdHeaderFooterFirstPage).Exists = True Then
aSection.Headers(wdHeaderFooterFirstPage).Range.Text = "First Page"
End If