Method ApplyListTemplate
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
documentWordDocumentThe document that holds the span.
spanDocumentSpanThe span.
templateListTemplateThe list's definition.
Returns
- DocumentEdit
The edit; undoing it also removes a list it added.
Exceptions
- ArgumentNullException
documentortemplateis null.- ArgumentException
The span is not in
document.