Linking/Unlinking Previous
The LinkToPrevious property applies to each type of header and each type of footer separately.
Setting this to True automatically inserts text into all headers (and footers)
Setting this to False does not automatically remove the text.
objHeaderFooter.LinkToPrevious = True | False
The following will unlink the current header from the previous header
iNoOfSections = ActiveDocument.Sections.Count
With Application.ActiveDocument.Sections(iNoOfSections).Headers(wdHeaderFooterIndex.wdHeaderFooterPrimary)
.LinkToPrevious = False
.Range.Delete ''this line deletes everything from the header to make sure it is blank
End With
The following will unlink the current footer from the previous footer
iNoOfSections = ActiveDocument.Sections.Count
With Application.ActiveDocument.Sections(iNoOfSections).Footers(wdHeaderFooterIndex.wdHeaderFooterPrimary)
.LinkToPrevious = False
.Range.Delete ''this line deletes everything from the header to make sure it is blank
End With
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext