Table of Contents

Method FindFields

Namespace
DocWright.Dom.Fields
Assembly
DocWright.Dom.dll

FindFields(DomNode)

Finds every field in a subtree, in document order.

public static IReadOnlyList<FieldRegion> FindFields(this DomNode root)

Parameters

root DomNode

The subtree root.

Returns

IReadOnlyList<FieldRegion>

The fields found.

Remarks

Only top-level fields are returned; a field nested inside another's instruction is reachable through NestedFields.

Walking a WordDocument covers every root the document owns: Children is a composite over the sections, the headers and footers, the footnotes and the endnotes, in that order. Body content therefore comes first and a field in a letterhead header is reached without a second call.

Exceptions

ArgumentNullException

root is null.

FindFields(DomNode, FieldKind)

Finds every field of one kind in a subtree, in document order.

public static IReadOnlyList<FieldRegion> FindFields(this DomNode root, FieldKind kind)

Parameters

root DomNode

The subtree root.

kind FieldKind

The field kind to keep.

Returns

IReadOnlyList<FieldRegion>

The matching fields.

Exceptions

ArgumentNullException

root is null.