set_textbox_text
Replace the text of a specified text box in a Word document while preserving its first paragraph style and run formatting. Supports multi-paragraph text with \n and refuses non-text boxes.
Instructions
Replace the text of one text box (box_index from get_textbox_text). Keeps the first paragraph's style and first run's formatting; '\n' splits into multiple paragraphs; the mc:Fallback compatibility copy is rewritten to match. Boxes holding non-text content (nested tables, images) are refused rather than flattened. 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 |
|---|---|---|---|
| text | Yes | ||
| backup | No | ||
| box_index | Yes | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||