Table of Contents

Method InsertSectionBreak

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

InsertSectionBreak(WordDocument, DocumentPosition, SectionStartKind)

Inserts a section break at a position, as one undoable edit.

public static DocumentEdit InsertSectionBreak(this WordDocument document, DocumentPosition at, SectionStartKind kind)

Parameters

document WordDocument

The document that holds the position.

at DocumentPosition

Where the break goes: in a paragraph directly in a section's body (not in a table, a content control, a header or a note).

kind SectionStartKind

How the new section starts: next page, continuous, even page or odd page (next column too).

Returns

DocumentEdit

The edit; After is the start of the new section.

Exceptions

ArgumentNullException

document is null.

ArgumentException

The position is not in document, or the kind is not defined.

InvalidOperationException

The position is not in a paragraph directly in a section's body.