Identifies the type of header or footer found in a Word file.
[Visual Basic]
Public Enum HeaderFooterType
[C#]public enum HeaderFooterType
Example
Deletes all footers from all sections, but leaves headers intact.
[C#]
Document doc = new Document(MyDir + "HeaderFooter.RemoveFooters.doc");
foreach (Section section in doc)
{
// Up to three different footers are possible in a section (for first, even and odd pages).
// We check and delete all of them.
HeaderFooter footer;
footer = section.HeadersFooters[HeaderFooterType.FooterFirst];
if (footer != null)
footer.Remove();
// Primary footer is the footer used for odd pages.
footer = section.HeadersFooters[HeaderFooterType.FooterPrimary];
if (footer != null)
footer.Remove();
footer = section.HeadersFooters[HeaderFooterType.FooterEven];
if (footer != null)
footer.Remove();
}
doc.Save(MyDir + "HeaderFooter.RemoveFooters Out.doc");[Visual Basic]
Dim doc As Document = New Document(MyDir & "HeaderFooter.RemoveFooters.doc")
For Each section As Section In doc
' Up to three different footers are possible in a section (for first, even and odd pages).
' We check and delete all of them.
Dim footer As HeaderFooter
footer = section.HeadersFooters(HeaderFooterType.FooterFirst)
If Not footer Is Nothing Then
footer.Remove()
End If
' Primary footer is the footer used for odd pages.
footer = section.HeadersFooters(HeaderFooterType.FooterPrimary)
If Not footer Is Nothing Then
footer.Remove()
End If
footer = section.HeadersFooters(HeaderFooterType.FooterEven)
If Not footer