HeaderFooterIsHeader Property

True if this HeaderFooter object is a header.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public bool IsHeader { get; }

Property Value

Type: Boolean
Examples
Creates a header and footer using the document object model and insert them into a section.
Document doc = new Document();

HeaderFooter header = new HeaderFooter(doc, HeaderFooterType.HeaderPrimary);
doc.FirstSection.HeadersFooters.Add(header);

// Add a paragraph with text to the footer
Paragraph para = header.AppendParagraph("My header");

Assert.True(header.IsHeader);
Assert.True(para.IsEndOfHeaderFooter);

HeaderFooter footer = new HeaderFooter(doc, HeaderFooterType.FooterPrimary);
doc.FirstSection.HeadersFooters.Add(footer);

// Add a paragraph with text to the footer
para = footer.AppendParagraph("My footer");

Assert.False(footer.IsHeader);
Assert.True(para.IsEndOfHeaderFooter);

Assert.AreEqual(footer, para.ParentStory);
Assert.AreEqual(footer.ParentSection, para.ParentSection);
Assert.AreEqual(footer.ParentSection, header.ParentSection);

doc.Save(ArtifactsDir + "HeaderFooter.HeaderFooterCreate.docx");
See Also