Skip to content

word textbox

zmworm edited this page Jun 13, 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)
rotation / rot Rotation in degrees
verticalText / vert eaVert (CJK vertical), vert (rotated 90°), vert270, wordArtVert, wordArtVertRtl
gradient Linear gradient C1;C2[;ANGLE] or radial:C1;C2
shadow COLOR[;BLUR[;ANGLE[;DIST[;OPACITY]]]] or none
opacity 0.0–1.0 or 0–100 — auto-scaled

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"

# Rotated CJK vertical textbox with gradient and shadow
officecli add report.docx /body/p[1] --type textbox \
  --prop rotation=15 --prop verticalText=eaVert \
  --prop gradient="4472C4;ED7D31;45" \
  --prop shadow="000000;6;45;3;60" --prop opacity=0.85 \
  --prop text="标题"

See Also


Based on OfficeCLI v1.0.112

Clone this wiki locally