Method FindFields
FindFields(DomNode)
Finds every field in a subtree, in document order.
public static IReadOnlyList<FieldRegion> FindFields(this DomNode root)
Parameters
rootDomNodeThe 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
rootis 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
Returns
- IReadOnlyList<FieldRegion>
The matching fields.
Exceptions
- ArgumentNullException
rootis null.