IsHeader Property [Publisher 2003 VBA Language Reference]

True if the specified HeaderFooter object is a header, False if it is a footer. Read only Boolean.

expression.IsHeader

expression Required. An expression that returns a HeaderFooter object.

Example

The following example creates a new collection and fills it with the headers and footer from each master page. The collection is then iterated and a test is made to determine if the HeaderFooter object is a header or a footer, then appropriate text is written to the header or footer.

Dim objHeadersFooters As Collection
Dim objMasterPage As page
Dim objHeadFoot As HeaderFooter

Set objHeadersFooters = New Collection
For Each objMasterPage In ActiveDocument.masterPages
    objHeadersFooters.Add objMasterPage.Header
    objHeadersFooters.Add objMasterPage.Footer
Next objMasterPage

For Each objHeadFoot In objHeadersFooters
    If objHeadFoot.IsHeader = True Then
        objHeadFoot.TextRange.Text = "Header Text"
    ElseIf objHeadFoot.IsHeader = False Then
        objHeadFoot.TextRange.Text = "Footer Text"
    End If
Next

Applies to | HeaderFooter Object