Document apiReferenceContent controls
contentControls.getContent
Get the text content of a content control and optionally its ordered source runs and direct formatting.
read-onlyidempotent
doc.contentControls.getContent(…)Expected result
Returns content and format, with source runs when includeRuns is true.
Inputs
targetobjectrequiredFields
kind"block" | "inline"requirednodeType"sdt"requirednodeIdstringrequiredstoryStoryLocatorStory scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes.
body
kind"story"requiredstoryType"body"requiredheaderFooterSlot
kind"story"requiredstoryType"headerFooterSlot"requiredsectionSectionAddressrequiredheaderFooterKind"header" | "footer"requiredvariant"default" | "first" | "even"requiredresolution"effective" | "explicit"onWrite"materializeIfInherited" | "editResolvedPart" | "error"headerFooterPart
kind"story"requiredstoryType"headerFooterPart"requiredrefIdstringrequiredfootnote
kind"story"requiredstoryType"footnote"requirednoteIdstringrequiredendnote
kind"story"requiredstoryType"endnote"requirednoteIdstringrequiredtextbox
kind"story"requiredstoryType"textbox"requiredtextboxIdstringrequired1 additional input field
includeRunsbooleanInclude current WordprocessingML runs in source order, including empty runs. Defaults to false.
Result
Output fields
contentstringrequiredformat"text" | "html"requiredrunsobject[]Failures
Pre-apply throws
TARGET_NOT_FOUNDINVALID_INPUTCAPABILITY_UNAVAILABLE
3 more codes
INVALID_TARGETAMBIGUOUS_TARGETPRECONDITION_FAILED
Raw schemas
Open the generated JSON artifact for the exact input, output, success, and failure schemas represented by this contract version.
View raw JSON schemas