Table of Contents

Method AddHeaderFooter

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

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

document WordDocument

The document.

section Section

The section.

kind HeaderFooterKind

Header or footer.

type HeaderFooterType

Which 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.