Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

command set word

zmworm edited this page Apr 29, 2026 · 53 revisions

set - Word (.docx)

Settable elements in Word documents.

Elements

Element Path Reference
Document Root / Word-Document-Set
Paragraph /body/p[N] Word-Paragraph-Set
Run /body/p[N]/r[M] Word-Run-Set
Table / Row / Cell /body/tbl[N] Word-Table-Set
Header / Footer /header[N], /footer[N] Word-Header-Footer-Set
Watermark /watermark Word-Watermark-Set
Section /section[N] Word-Section-Set
Bookmark /bookmark[Name] Word-Bookmark-Set
Footnote / Endnote /footnote[N], /endnote[N] Word-Footnote
TOC /toc[N] Word-TOC
Style /styles/{StyleId} Word-Style-Set
Chart /chart[N] Word-Chart-Set

Find & Format / Find & Replace

Use find= to locate text within a document and apply formatting or replace it. The matching text is automatically split into its own run(s) so formatting applies precisely.

Path controls the search scope — use / for the whole document, or a specific path like /body/p[1] to narrow the search.

Properties

Property Description
find Text to match. Add regex=true prop for regex (e.g. find=\d+% with --prop regex=true)
replace Replacement text. Omit to format in-place without replacing
All run-level props bold, italic, color, highlight, underline, strike, font, size, charSpacing, shading, superscript, subscript, caps, smallCaps, vanish — applied to matched runs

Examples

# Highlight all occurrences of "weather" in paragraph 1
officecli set doc.docx '/body/p[1]' --prop find=weather --prop highlight=yellow
# Color all percentage values red (regex)
officecli set doc.docx / --prop 'find=\d+%' --prop regex=true --prop color=red
# Simple find & replace across the whole document
officecli set doc.docx / --prop find=旧 --prop replace=新
# Find & replace with formatting
officecli set doc.docx '/body/p[1]' --prop find=TODO --prop replace=DONE --prop bold=true

See Also


Based on OfficeCLI v1.0.64

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /