Table of Contents

Method ApplyListTemplate

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

ApplyListTemplate(WordDocument, DocumentSpan, ListTemplate)

Puts every paragraph a span touches in a list defined by a template (Word's galleries: ListLibrary), as one edit: a new list from the template, unless the paragraph before the span is in a list made from the same template, which is continued. A paragraph keeps its list level (0 when it had none).

public static DocumentEdit ApplyListTemplate(this WordDocument document, DocumentSpan span, ListTemplate template)

Parameters

document WordDocument

The document that holds the span.

span DocumentSpan

The span.

template ListTemplate

The list's definition.

Returns

DocumentEdit

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

Exceptions

ArgumentNullException

document or template is null.

ArgumentException

The span is not in document.