Skip to content

word run

zmworm edited this page Apr 29, 2026 · 51 revisions

Word: Run (Text Segment)

Inline text segment within a paragraph, carrying its own character formatting.

Path: /body/p[N]/r[M]

Operations

  • get - Returned attributes and output format

  • add - Add formatted text segments to paragraphs

  • set - Modify run formatting and content

get

officecli get report.docx /body/p[1]/r[1]

query

Selector: run, r (child selector only, use with >)

Attribute Description
font Font name
size Font size
bold Boolean
italic Boolean
officecli query report.docx "p[alignment=center] > r[bold=true]"
officecli query report.docx 'r:contains("error")'
officecli query report.docx "r[font=Arial]"

remove

officecli remove report.docx /body/p[1]/r[2]

Based on OfficeCLI v1.0.64

Clone this wiki locally