word_replace
Replace text in Word documents while preserving formatting. Provide source and output paths plus a JSON replacement map to update .docx files.
Instructions
Replace text in a Word document, preserving all formatting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | source .docx path | |
| fmt_hints | No | optional JSON string with run-format hints, e.g.: {"_fmt:p:1": {"runs": [{"text": "中一", "underline": true}]}} | |
| output_path | Yes | where to save the new .docx | |
| replacements | Yes | JSON string with replacement map, e.g.: {"p:0": "new title", "c:0:3:0": "line1\nline2", "c:0:2:1:0": "topic"} |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||