Does a Header or Footer Exists

In any document the three types of headerfooter objects always exist although the property will be set to False when they are not visible or not being used within a document.

The Exists property can be used to determine whether a first page or odd page header / footer exists

Dim bExists As Boolean 
bExists = ActiveDocument.Sections(1).Headers(wdHeaderFooterIndex.wdHeaderFooterFirstPage).Exists

bExists = ActiveDocument.Sections(1).Headers(wdHeaderFooterIndex.wdHeaderFooterEvenPages).IsHeader 
bExists = ActiveDocument.Sections(1).Footers(wdHeaderFooterIndex.wdHeaderFooterEvenPages).IsFooter

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext