Table of Contents

Method ApplyParagraphStyle

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

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

document WordDocument

The document that holds the span.

span DocumentSpan

The span.

styleId string

The style id, or null for the document's default paragraph style.

Returns

DocumentEdit

The edit.

Exceptions

ArgumentNullException

document is null.

ArgumentException

The span is not in document, or styleId names no paragraph style of the document.

InvalidOperationException

An end is in a shape's text box.