Table of Contents

Method Spans

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

Spans(WordDocument, string)

Every use of a style as a span, in document order, counted as Count(WordDocument) counts them (Word's Styles pane "Select All N Instance(s)", Phase 150): a paragraph style's whole paragraphs; a character style's stretches of consecutive runs; a table style's tables. Headers, footers and notes included, as the count is.

public static IReadOnlyList<DocumentSpan> Spans(WordDocument document, string styleId)

Parameters

document WordDocument

The document.

styleId string

The style's id; the default paragraph style's covers paragraphs stating none.

Returns

IReadOnlyList<DocumentSpan>

The spans; empty for a style the text does not use.

Exceptions

ArgumentNullException

An argument is null.