-
Notifications
You must be signed in to change notification settings - Fork 108
command set
zmworm edited this page Mar 31, 2026
·
23 revisions
Modify properties of a document element.
officecli set <file> <path> --prop <key=value> [--prop <key=value> ...]
Modifies one or more properties of the element at the specified path. Multiple properties can be set by repeating --prop. Reports which properties were applied and which were unsupported.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
file |
FileInfo | Yes | - | Office document path |
path |
string | Yes | - | DOM path to the element |
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
--prop |
string (repeatable) | Yes | - | Property in key=value format |
-
Word set - All settable elements in
.docx -
Excel set - All settable elements in
.xlsx -
PowerPoint set - All settable elements in
.pptx
- Property keys are case-insensitive.
- Boolean values:
true/1/yes(truthy),false/0/no/empty (falsy). - Color values: hex RGB without
#prefix (e.g.,FF0000). - Dimensions: EMU or with unit suffix (
cm,in,pt,px). -
Query-selector paths (PPT/Excel): You can use CSS-like selector paths in the
setcommand to target elements by attribute, e.g.,officecli set slides.pptx "shape[name=Title]" --prop text="Hello". -
Auto-create styles (Word): Setting properties on a non-existent
/styles/{StyleId}path automatically creates the style.
- Command Reference
- get - Inspect element before modifying
- add - Add new elements
Based on OfficeCLI v1.0.28