Method FindContentControlsEverywhere
- Namespace
- DocWright.Dom.ContentControls
- Assembly
- DocWright.Dom.dll
FindContentControlsEverywhere(WordDocument)
Finds every content control in the document body, its headers and footers, and its notes.
public static IReadOnlyList<ContentControl> FindContentControlsEverywhere(this WordDocument document)
Parameters
documentWordDocumentThe document.
Returns
- IReadOnlyList<ContentControl>
The controls found, body first.
Remarks
Equivalent to FindContentControls(DomNode) on the same document, and kept because it names the guarantee a form-filling pass depends on: a control in a letterhead header is included, and skipping it leaves a document that still looks structurally correct.
It used to append the headers, footers and notes to that walk. They were already in it — Children has been a composite over all four collections since the DOM was written — so every control outside the body was returned twice, and a caller iterating the result filled each of them twice.
A control inside a text box is not reached. Shape content is emitted from a preserved island, so a control there exists in the markup DocWright re-emits but not as a node this walk can see.
Exceptions
- ArgumentNullException
documentis null.