Class HeaderFooterEditingExtensions
A section's headers and footers added, removed and linked as DocumentEdits, and a field inserted at a position, as Word does (WQ-0096). Text in a header or footer is edited through the same position edits as the body's: its paragraphs are the document's.
public static class HeaderFooterEditingExtensions
- Inheritance
-
HeaderFooterEditingExtensions
- Inherited Members
Remarks
A section without a header or footer of a type uses the previous section's (Word's "Link to Previous"); the first section without one has none. AddHeaderFooter(WordDocument, Section, HeaderFooterKind, HeaderFooterType) gives a section its own: a copy of the one it used (Word keeps the content when the link is broken) or, when it used none, one empty paragraph in Word's Header or Footer style. RemoveHeaderFooter(WordDocument, Section, HeaderFooterKind, HeaderFooterType) takes it away again, so the section links to the previous one.
Fields
- MaxFieldInstructionLength
The longest field instruction InsertField(WordDocument, DocumentPosition, string, FieldUpdateOptions?) takes.
Methods
- 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.
- GetEffectiveHeaderFooter(WordDocument, Section, HeaderFooterKind, HeaderFooterType)
The header or footer a section uses: its own, else the nearest previous section's (Link to Previous), or null.
- GetHeaderFooter(Section, HeaderFooterKind, HeaderFooterType)
The section's own header or footer of a type, or null when it has none (it links to the previous section's).
- InsertField(WordDocument, DocumentPosition, string, FieldUpdateOptions?)
Inserts a field (Word's complex field: begin, instruction, separator, result, end) at a position, its result what the field evaluates to now; a field the layout evaluates per page (PAGE, NUMPAGES) shows the page it is drawn on.
- RemoveHeaderFooter(WordDocument, Section, HeaderFooterKind, HeaderFooterType)
Takes a section's own header or footer of a type away: the section then uses the previous section's (Link to Previous), or none. The part leaves the document when no section uses it.