Skip to content

word textbox

zmworm edited this page May 24, 2026 · 2 revisions

Word: Textbox

DrawingML text box (w:drawingwps:wsp with txBox="1"). Carries an inner wps:txbx body that can hold paragraphs and runs.

Path: /body/p[N]/textbox[M]

Operations

  • add — create a new textbox with geometry, fill, line, wrap, alt text, anchor offsets
  • get — read full Add+Get symmetry (geometry/fill/line/wrap/alt/anchor)
  • set — modify any of the above
  • remove — delete

Add properties

Property Description
x / y, width / height Position and size (EMU or unit-qualified)
geometry / preset Shape preset (rect, roundRect, ellipse, …)
fill Solid fill color (hex)
line.color / line.width / line.dash Outline
wrap Anchor wrap: inline, square, tight, topAndBottom, behind, inFront
alt Alt text
anchor.x / anchor.y Anchor offsets (floating layout)
text Initial text content (single run shortcut)

Examples

# Floating textbox at fixed position
officecli add report.docx /body/p[1] --type textbox --prop x=2cm --prop y=4cm --prop width=8cm --prop height=3cm --prop fill=FFF2CC --prop text="Sidebar note"

# Rounded textbox with outline
officecli add report.docx /body/p[1] --type textbox --prop geometry=roundRect --prop line.color=4472C4 --prop line.width=1pt --prop text="Pull-quote"

See Also


Based on OfficeCLI v1.0.97

Clone this wiki locally