word_set_section
Configure a section's orientation and page size in a Word document. Supports portrait or landscape and named sizes like A4, Letter, Legal.
Instructions
Configure a section's orientation and page size.
Args:
path: Path to an existing .docx.
orientation: "portrait" or "landscape" (case-insensitive).
Any other value raises ERR_INVALID_PARAMS
(VAL-WORD-065).
page_size: A named page size such as "A4" (default),
"Letter", "Legal", "A5", "Tabloid" or
"B5" (case-insensitive).
section_index: Zero-based section index (default 0).
folder: Optional base folder for relative paths.
Returns:
{"ok": True}.
Behavior:
* Portrait: page_width = <width>, page_height = <height>.
* Landscape: page_width = <height>, page_height = <width>
(i.e. dimensions are swapped so the wider edge is horizontal).
Raises:
OfficeMCPError: ERR_INVALID_PARAMS for an unknown
orientation or page_size, ERR_FILE_NOT_FOUND
if the file is missing, ERR_UNSUPPORTED_FMT for
non-.docx extensions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| orientation | No | portrait | |
| page_size | No | A4 | |
| section_index | No | ||
| folder | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||