ReferenceContent Controls

Content Controls operations

Content control (SDT) discovery, mutation, typed controls, and Word compatibility.

55 operations. Names, descriptions, and behavior flags come from the canonical contract. Job groupings are curated for navigation.

Discover and inspect

contentControls.checkbox.getStateGet the checked state of a checkbox content control.readcontentControls.choiceList.getItemsGet the list items and selected value of a comboBox or dropDownList content control.readcontentControls.getRetrieve a single content control by target.readcontentControls.getBindingGet the data binding metadata (w:dataBinding) of a content control.readcontentControls.getContentGet the text content of a content control.readcontentControls.getParentGet the parent content control of the target, if any.readcontentControls.getRawPropertiesGet the raw sdtPr properties of a content control as a passthrough hash.readcontentControls.listList all content controls in the document with optional type/tag filtering.readcontentControls.listChildrenList direct child content controls nested inside the target.readcontentControls.listInRangeList content controls within a block range.readcontentControls.selectByTagSelect content controls matching a specific tag value.readcontentControls.selectByTitleSelect content controls matching a specific title (alias) value.readcontentControls.validateWordCompatibilityValidate a content control for Word compatibility issues.read

Create, wrap, and place

contentControls.appendContentAppend content to the end of a content control.mutatescontentControls.copyCopy a content control to a destination position. Copied SDTs receive new IDs.mutatescontentControls.deleteDelete a content control and its content from the document.mutatescontentControls.insertAfterInsert content immediately after a content control.mutatescontentControls.insertBeforeInsert content immediately before a content control.mutatescontentControls.moveMove a content control to a new position: before or after another SDT, to the document start or end, or to an arbitrary caret inside a paragraph (the inParagraph destination) for drag-and-drop. Direct moves preserve the original ID; tracked-mode authoring supports safe top-level block SDTs (SDT-to-SDT destinations only) and remaps the destination SDT ID to avoid duplicate live anchors.mutatestrackedcontentControls.prependContentPrepend content to the beginning of a content control.mutatescontentControls.unwrapRemove the content control wrapper, preserving its content in place.mutatescontentControls.wrapWrap existing content with a new content control.mutatescreate.contentControlCreate a new content control (SDT) in the document, optionally seeded with plain text or structured block preset content.mutates

Values and typed controls

contentControls.checkbox.setStateSet the checked state of a checkbox content control.mutatescontentControls.checkbox.setSymbolPairSet the checked and unchecked symbol glyphs for a checkbox content control.mutatescontentControls.checkbox.toggleToggle the checked state of a checkbox content control.mutatescontentControls.choiceList.setItemsReplace the list items of a comboBox or dropDownList content control.mutatescontentControls.choiceList.setSelectedSet the selected value of a comboBox or dropDownList content control.mutatescontentControls.clearContentClear all content inside a content control, leaving it empty.mutatescontentControls.date.clearValueClear the date value of a date content control.mutatescontentControls.date.setCalendarSet the calendar type for a date content control.mutatescontentControls.date.setDisplayFormatSet the display format string for a date content control.mutatescontentControls.date.setDisplayLocaleSet the display locale for a date content control.mutatescontentControls.date.setStorageFormatSet the XML storage format for a date content control.mutatescontentControls.date.setValueSet the date value of a date content control.mutatescontentControls.replaceContentReplace the entire content of a content control.mutatestrackedcontentControls.text.clearValueClear the text value of a plain-text content control.mutatescontentControls.text.setMultilineSet or clear the multiline attribute on a plain-text content control.mutatescontentControls.text.setValueSet the text value of a plain-text content control.mutates

Locking, metadata, and XML binding

contentControls.clearBindingRemove data binding metadata from a content control.mutatescontentControls.normalizeTagPayloadNormalize a content control tag between plain-string and JSON-encoded formats.mutatescontentControls.normalizeWordCompatibilityNormalize a content control to resolve Word compatibility issues.mutatescontentControls.patchPatch metadata properties on a content control (tag, alias, appearance, color, etc.).mutatescontentControls.patchRawPropertiesApply raw XML-level patches to the sdtPr subtree of a content control.mutatescontentControls.setBindingSet data binding metadata on a content control.mutatescontentControls.setLockModeSet the lock mode on a content control.mutatescontentControls.setTypeTransition a content control to a different semantic type. Metadata-only; no implicit content rewrite.mutates

Repeating sections and groups

contentControls.group.ungroupRemove the group designation from a group content control.mutatescontentControls.group.wrapWrap a content control inside a new group content control. Always nests; not idempotent.mutatescontentControls.repeatingSection.cloneItemClone a repeating section item at the given index. Cloned SDTs receive new IDs.mutatescontentControls.repeatingSection.deleteItemDelete a repeating section item at the given index.mutatescontentControls.repeatingSection.insertItemAfterInsert a new item after a specific index in a repeating section.mutatescontentControls.repeatingSection.insertItemBeforeInsert a new item before a specific index in a repeating section.mutatescontentControls.repeatingSection.listItemsList the repeating section items inside a repeating section content control.readcontentControls.repeatingSection.setAllowInsertDeleteSet the allowInsertDelete flag on a repeating section.mutates