Skip to content

word section set

zmworm edited this page Mar 21, 2026 · 52 revisions

Word: Section - set

Modify section page layout, orientation, and margins.

Path: /section[N]

Properties

Property Accepted Values Description
type continuous, evenPage/even, oddPage/odd, nextPage/next Break type. Invalid values throw an error.
pageWidth twips Width
pageHeight twips Height
orientation landscape, portrait Orientation. Setting landscape auto-swaps width/height if misaligned.
marginTop/Bottom/Left/Right twips Margins
columns/cols/col "3" or "3,720" Column count, or count with space (twips)
colWidths alternating values Custom column widths: "width,space,width,space,..." (twips)
separator/sep bool Line between columns

Examples

officecli set report.docx /section[2] --prop orientation=landscape --prop pageWidth=15840 --prop pageHeight=12240

# Set 3 equal columns
officecli set report.docx /section[1] --prop columns=3

# Set 3 columns with custom spacing (720 twips)
officecli set report.docx /section[1] --prop cols="3,720"

# Set custom column widths with spacing
officecli set report.docx /section[1] --prop colWidths="3000,720,2000,720,3000"

# Add separator line between columns
officecli set report.docx /section[1] --prop columns=2 --prop separator=true

Based on OfficeCLI v1.0.11

Clone this wiki locally