Method AddHeaderFooter
AddHeaderFooter(WordDocument, Section, HeaderFooterKind, HeaderFooterType)
Gives a section its own header or footer of a type: a copy of the one it used (the link to the previous section is broken, the content kept), or one empty paragraph in Word's Header or Footer style.
public static DocumentEdit AddHeaderFooter(this WordDocument document, Section section, HeaderFooterKind kind, HeaderFooterType type)
Parameters
documentWordDocumentThe document.
sectionSectionThe section.
kindHeaderFooterKindHeader or footer.
typeHeaderFooterTypeWhich pages.
Returns
- DocumentEdit
The edit (empty when the section has its own already); After is the start of the part's first paragraph.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentException
The section is not in
document, or a type is not defined.