Skip to content

word comment add

goworm edited this page Jun 26, 2026 · 53 revisions

Word: Comment - add

Add a review comment attached to a paragraph or run.

Parent: /body/p[N] or /body/p[N]/r[M]

Properties

Property Default Description
text (required) Comment text
author officecli Author
initials first char Initials
date now ISO date
runStart / runstart 0 1-based run index inside the parent paragraph where the comment range starts. N=0 (default) anchors the comment to paragraph start; N>=1 places <w:commentRangeStart/> immediately after the Nth run so dump->batch round-trip restores intra-paragraph anchor positions.
parentId - w:id of the comment this one replies to. Threads the reply under its parent in Word's review pane via word/commentsExtended.xml (w15:paraIdParent, keyed by the comment paragraphs' w14:paraId). Get returns the parent comment's w:id on replies only.
done / resolved false Resolved-state (Word's Resolve) stored as w15:done in commentsExtended.xml. Settable via Set as well; Get returns `done=true

Unknown props are now reported via the standard UNSUPPORTED warning (no more silent typos).

Examples

officecli add report.docx /body/p[1] --type comment --prop text="Please review this paragraph" --prop author="QA"

# Reply to comment 1
officecli add report.docx /body/p[1] --type comment --prop text="Fixed in r3" --prop parentId=1

# Mark a comment resolved
officecli set report.docx /comments/comment[1] --prop done=true

# List open comments
officecli query report.docx 'comment[done=false]'

Based on OfficeCLI v1.0.117

Clone this wiki locally