Skip to content

word paragraph

zmworm edited this page Apr 18, 2026 · 46 revisions

Word: Paragraph

Block-level text container with formatting, indentation, and list support.

Path: /body/p[N]

Operations

  • get - Returned attributes and output format

  • add - Add paragraphs with text, styles, and lists

  • set - Modify paragraph formatting and properties

get

officecli get report.docx /body/p[1]
officecli get report.docx /body/p[1] --depth 2

query

Selectors: paragraph, p

Attribute Description
style Style name or ID (case-insensitive)
alignment left, center, right, justify
firstLineIndent Indent value
numId Numbering ID
numLevel/ilvl Numbering level
listStyle List style

Pseudo-selectors: :contains("text"), :empty

officecli query report.docx "p[style=Heading1]"
officecli query report.docx "p[alignment=center]"
officecli query report.docx "p:empty"
officecli query report.docx 'p:contains("conclusion")'
officecli query report.docx "p[style!=Normal]"

remove

officecli remove report.docx /body/p[3]

move

officecli move report.docx /body/p[5] --index 0

Based on OfficeCLI v1.0.52

Clone this wiki locally