Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

word paragraph set

zmworm edited this page Apr 27, 2026 · 52 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 twips or unit-qualified First line indent. Accepts bare twips (OOXML native) or unit-qualified strings: 2cm, 0.5in, 18pt. Max 31680 twips (22 inches).
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
contextualSpacing bool Suppress spaceBefore/spaceAfter between paragraphs of the same style. false omits the element on Add (toggle parity with OOXML default).
numId integer Numbering instance ID (must reference an existing /numbering/num[@id=N]; negative values rejected)
ilvl 0–8 Numbering level (clamped to 0..8)
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.56

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /