-
Notifications
You must be signed in to change notification settings - Fork 102
command get word
zmworm edited this page Mar 31, 2026
·
23 revisions
Available paths for getting Word document elements.
| Path | Description |
|---|---|
/ |
Document root (metadata, page setup) |
/body |
Document body |
/body/p[N] |
Nth paragraph |
/body/p[N]/r[M] |
Mth run in paragraph N |
/body/tbl[N] |
Nth table |
/body/tbl[N]/tr[M] |
Row M in table N |
/body/tbl[N]/tr[M]/tc[K] |
Cell K in row M |
/header[N] |
Nth header |
/footer[N] |
Nth footer |
/styles |
Style definitions |
/styles/{StyleId} |
Specific style by ID or name |
/bookmark[Name] |
Bookmark by name |
/footnote[N] |
Footnote by ID |
/endnote[N] |
Endnote by ID |
/toc[N] |
Table of contents |
/chart[N] |
Embedded chart |
/section[N] |
Section properties |
/watermark |
Document watermark |
/numbering |
Numbering definitions |
# Get document metadata
officecli get report.docx /
# Get first paragraph with its runs
officecli get report.docx /body/p[1]
# Get deeper structure
officecli get report.docx /body/tbl[1] --depth 3
# Get a specific table cell
officecli get report.docx /body/tbl[1]/tr[2]/tc[3]
# Get a bookmark
officecli get report.docx "/bookmark[Introduction]"
# Get a header
officecli get report.docx /header[1]
# Get a style definition
officecli get report.docx /styles/Heading1
# Get as JSON
officecli get report.docx /body/p[1] --json- get - Command syntax
- Word Reference - All Word elements
Based on OfficeCLI v1.0.28