Table of contents
Collapse the table of content
Expand the table of content

HeaderFooter.IsHeader Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
3 Contributors

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


expression. IsHeader

_expression_A variable that represents an HeaderFooter object.

Return Value



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 whether 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 
© 2018 Microsoft