Skip to content

command set

zmworm edited this page Mar 31, 2026 · 23 revisions

set

Modify properties of a document element.

Synopsis

officecli set <file> <path> --prop <key=value> [--prop <key=value> ...]

Description

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.

Arguments

Name Type Required Default Description
file FileInfo Yes - Office document path
path string Yes - DOM path to the element

Options

Name Type Required Default Description
--prop string (repeatable) Yes - Property in key=value format

Format-Specific References

Notes

  • 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 set command 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.

See Also


Based on OfficeCLI v1.0.28

Clone this wiki locally