split_document
Split a Word document into one standalone .docx per heading section, preserving formatting and leaving the source unchanged. Use to break large documents into organized parts.
Instructions
Split a document into one standalone .docx per heading section, the
inverse of com_merge_documents (no Word needed). Sections start at each
heading of level (or higher) and carry everything to the next one;
content before the first heading becomes 00_front_matter.docx when
non-empty. Outputs carry the source's styles, numbering, settings,
fonts, and themes; other sections' note definitions and image parts are
stripped; every output is round-trip validated. filename_from:
'heading' gives 01_Heading Text.docx, 'index' gives 01.docx. The source
file is never modified; existing output files are refused before
anything is written.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | ||
| file_path | Yes | ||
| output_dir | Yes | ||
| filename_from | No | heading |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||