Method Spans
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
documentWordDocumentThe document.
styleIdstringThe 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.