Method ApplyParagraphStyle
ApplyParagraphStyle(WordDocument, DocumentSpan, string?)
Applies a paragraph style to every paragraph a span touches; direct formatting stays.
public static DocumentEdit ApplyParagraphStyle(this WordDocument document, DocumentSpan span, string? styleId)
Parameters
documentWordDocumentThe document that holds the span.
spanDocumentSpanThe span.
styleIdstringThe style id, or null for the document's default paragraph style.
Returns
- DocumentEdit
The edit.
Exceptions
- ArgumentNullException
documentis null.- ArgumentException
The span is not in
document, orstyleIdnames no paragraph style of the document.- InvalidOperationException
An end is in a shape's text box.