insert_paragraphs
Insert paragraphs into a Word document at a precise location—after or before an index or unique anchor text, or at the end—with optional format cloning and tracked changes.
Instructions
Insert paragraphs ({text, style?, formatting?}) at ONE position:
after_index | before_index | after_anchor | at_end. Anchors match a
paragraph's PLAIN text (write '&', never the XML entity '&') and
must be unique; heading text recurs in body prose, so prefer index
addressing for structural work. On a fresh document, index 0 addresses
the implicit empty paragraph. inherit_format=True clones the anchor
paragraph's direct formatting onto the inserted paragraphs (a reference
entry matches its neighbors' hanging indent and font in one call); with
before_index/at_end use copy_format_from= instead
(mutually exclusive). Explicit per-item style/formatting wins; track
records tracked insertions by author. Format cloning is file-mode
only. Auto-backup in file mode: prev/anchor slots in .ks4w-backups
(backup=False skips rotation only); atomic validated save. Documents
open in Word are edited live.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| live | No | auto | |
| track | No | ||
| at_end | No | ||
| author | No | Claude | |
| backup | No | ||
| file_path | Yes | ||
| paragraphs | Yes | ||
| after_index | No | ||
| after_anchor | No | ||
| before_index | No | ||
| inherit_format | No | ||
| copy_format_from | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||