insert_content_control
Add a plain-text content control after a specified anchor in a Word document, assigning a unique tag for later form filling. Includes validated save with backup and refuses non-plain-text controls.
Instructions
Insert a new PLAIN-TEXT content control (inline SDT) right after
after_anchor text (plain paragraph text, literal characters;
occurrence picks which match when the anchor appears more than once),
with a unique tag (refused if it exists) and optional alias and initial
text. Plain text is the one control type this server can build safely;
creating checkbox, dropdown, date, picture, gallery, or repeating
controls is refused (list/fill still cover those when a template
provides them). Fill it later via fill_form_fields or
set_content_control_value by its tag. Auto-backup: prev/anchor slots
in .ks4w-backups (backup=False skips rotation only); atomic validated
save. Refuses documents open in Word.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | Yes | ||
| text | No | ||
| alias | No | ||
| backup | No | ||
| file_path | Yes | ||
| occurrence | No | ||
| after_anchor | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||