Skip to content

word paragraph set

zmworm edited this page Mar 27, 2026 · 19 revisions

Word: Paragraph - set

Modify paragraph formatting, style, indentation, spacing, and borders.

Path: /body/p[N]

Properties

Property Accepted Values Description
style style ID Paragraph style
alignment left, center, right, justify Text alignment
text text Set text of first run (or create run)
font font name Apply font to all runs
size number (pt) Apply size to all runs
bold bool Apply bold to all runs
italic bool Apply italic to all runs
color hex color Apply color to all runs
underline underline style Apply underline to all runs
strike/strikethrough bool Apply strikethrough to all runs
highlight highlight color Apply highlight to all runs
vertAlign superscript/super, subscript/sub, baseline Vertical alignment on runs
smallCaps bool Small capitals
firstLineIndent decimal (inches, x480) First line indent
leftIndent/indentLeft/indent integer (twips) Left indent
rightIndent/indentRight integer (twips) Right indent
hangingIndent/hanging integer (twips) Hanging indent
spaceBefore integer Space before
spaceAfter integer Space after
lineSpacing integer Line spacing
keepNext bool Keep with next
keepLines/keepTogether bool Keep together
pageBreakBefore bool Page break before
widowControl bool Widow/orphan control
shading/shd shading format Background
numId integer Numbering ID
numLevel/ilvl integer (0-8) Numbering level
listStyle bullet, numbered, none Quick list style
start integer List start number
formula LaTeX string Replace content with display math
pbdr.* style;size;color;space Paragraph borders (.top, .bottom, .left, .right, .between, .bar, .all)

Examples

# Change paragraph style
officecli set report.docx /body/p[1] --prop style=Heading1

# Make all text bold and centered
officecli set report.docx /body/p[1] --prop bold=true --prop alignment=center

# Set paragraph borders
officecli set report.docx /body/p[1] --prop "pbdr.bottom=single;4;FF0000;1"

# Change paragraph to a bulleted list
officecli set report.docx /body/p[3] --prop listStyle=bullet

Based on OfficeCLI v1.0.24

Clone this wiki locally