Method ApplyList
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
documentWordDocumentThe document that holds the span.
spanDocumentSpanThe span.
kindListKindBulleted or numbered.
Returns
- DocumentEdit
The edit; undoing it also removes a list it added.
Exceptions
- ArgumentNullException
documentis null.- ArgumentException
The span is not in
document, orkindis not defined.- InvalidOperationException
An end is in a shape's text box.