Table of Contents

Method ApplyList

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

ApplyList(WordDocument, DocumentSpan, ListKind)

Puts every paragraph a span touches in a list of kind. The list of the first paragraph, or else of the paragraph before it, is continued when it is of that kind; otherwise a list is added to the document from Word's default template for the kind. A paragraph keeps its list level (0 when it had none).

public static DocumentEdit ApplyList(this WordDocument document, DocumentSpan span, ListKind kind)

Parameters

document WordDocument

The document that holds the span.

span DocumentSpan

The span.

kind ListKind

Bulleted or numbered.

Returns

DocumentEdit

The edit; undoing it also removes a list it added.

Exceptions

ArgumentNullException

document is null.

ArgumentException

The span is not in document, or kind is not defined.

InvalidOperationException

An end is in a shape's text box.