Skip to content

word picture

zmworm edited this page Apr 19, 2026 · 47 revisions

Word: Picture / Image

Inline or floating image embedded in the document.

Path: (inline within paragraphs or floating in body)

Operations

  • add - Add inline or floating images
  • set - Modify picture properties (see below)

set

Property Accepted Values Description
width, height EMU or units Size
alt text Alternative text
wrap inline, square, tight, through, topAndBottom, behindText, inFrontOfText Text wrapping mode
hposition EMU or units Horizontal position
vposition EMU or units Vertical position
hrelative margin, page, column, character, leftMargin, rightMargin, insideMargin, outsideMargin Horizontal position reference
vrelative margin, page, paragraph, line, topMargin, bottomMargin, insideMargin, outsideMargin Vertical position reference
behindText bool Place image behind text (floating only)

get Attributes

Attribute Description
layout inline or anchor
wrap Text wrap type (for anchor)
x, y Position (cm)
width, height Size (cm)
hrelative, vrelative Position reference frames
behindText Whether image is behind text

query

officecli query report.docx "image"
officecli query report.docx "image:no-alt"

Examples

# Set tight text wrap
officecli set report.docx '/body/p[3]/picture[1]' --prop wrap=tight

# Position floating image relative to page
officecli set report.docx '/body/p[3]/picture[1]' --prop hposition=2cm --prop hrelative=page --prop vposition=5cm --prop vrelative=page

# Place image behind text as background
officecli set report.docx '/body/p[1]/picture[1]' --prop behindText=true

Based on OfficeCLI v1.0.53

Clone this wiki locally