Skip to content

word paragraph get

zmworm edited this page Apr 29, 2026 · 51 revisions

Word: Paragraph - get

Returned attributes when getting a paragraph element.

Path: /body/p[N]

Returned Attributes

Key Type Description
style string Paragraph style name
alignment string Alignment (left, center, right, both). Alias: align
spaceBefore string Space before paragraph (e.g. "12pt")
spaceAfter string Space after paragraph (e.g. "12pt")
lineSpacing string Line spacing: "1.5x" (auto/multiplier) or "18pt" (exact/atLeast)
firstlineindent integer First line indent (twips)
leftindent integer Left indent (twips)
rightindent integer Right indent (twips)
hangingindent integer Hanging indent (twips)
keepNext boolean Keep with next paragraph. Alias: keepnext
keepLines boolean Keep lines together. Alias: keeplines
pagebreakbefore boolean Page break before paragraph
widowcontrol boolean Widow/orphan control
shading string Shading fill color. Returns pattern;fill;color for non-clear patterns
pBdr.top string Top border definition
pBdr.bottom string Bottom border definition
pBdr.left string Left border definition
pBdr.right string Right border definition
pBdr.between string Between border definition
pBdr.bar string Bar border definition
numid integer Numbering definition ID
numlevel integer Numbering level
numFmt string Number format (decimal, bullet, lowerLetter, etc.)
listStyle string Associated list style name
start integer List start number
font string First-run font family name
size string First-run font size (with pt suffix, e.g. 12pt)
bold boolean First-run bold formatting
italic boolean First-run italic formatting
color string First-run font color (hex, e.g. #FF0000)
underline string First-run underline style
strike boolean First-run strikethrough

Children

Paragraph nodes contain Run (r) child elements.

Example

officecli get report.docx /body/p[1]
/body/p[1] (Paragraph) (2 children)
  style: Heading1
  alignment: center
  spaceAfter: 12pt
  keepNext: true
  keepLines: true
  font: Calibri Light
  size: 16pt
  bold: true
  color: #1F3864
officecli get report.docx /body/p[5]
/body/p[5] (Paragraph) (1 children)
  style: ListParagraph
  alignment: left
  leftindent: 720
  hangingindent: 360
  numid: 1
  numlevel: 0
  numFmt: bullet

Based on OfficeCLI v1.0.64

Clone this wiki locally