r7_docx_sections
Read or alter DOCX page setup and sections: set page size, orientation, margins, columns, page-number restart, and page/section breaks. Change one property without affecting other section elements.
Instructions
Read or change DOCX page setup and sections: page size, portrait/landscape, margins, columns, page-number restart, page breaks and section breaks. Changing one property preserves everything else in the section (headers, footers, columns, document grid, title-page setting).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | For insertBreak: page setup applied to the NEW (following) section. | |
| type | No | Section break type. | |
| action | No | read (default) reports every section and page break; set changes one section; insertBreak starts a new section. | |
| columns | No | Number of text columns. | |
| margins | No | Margins in centimetres: { top, right, bottom, left, header, footer, gutter }. | |
| titlePg | No | Different first-page header/footer. | |
| widthCm | No | Explicit page width in centimetres. | |
| filePath | Yes | Path to the DOCX file. | |
| heightCm | No | Explicit page height in centimetres. | |
| separator | No | Draw a vertical line between columns. | |
| outputPath | No | Write to a copy instead of editing in place. | |
| orientation | No | Page orientation. | |
| sectionIndex | No | Which section to change (0-based; -1 is the final section, which is the default). | |
| columnSpaceCm | No | Space between columns, in centimetres. | |
| pageNumberStart | No | Restart page numbering at this value. | |
| pageNumberFormat | No | Page number format. | |
| afterParagraphIndex | No | For insertBreak: the last paragraph of the section being closed. |