-
Notifications
You must be signed in to change notification settings - Fork 562
word textbox
zmworm edited this page May 24, 2026
·
2 revisions
DrawingML text box (w:drawing → wps:wsp with txBox="1"). Carries an inner wps:txbx body that can hold paragraphs and runs.
Path: /body/p[N]/textbox[M]
-
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
| 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) |
# 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"-
Word: Shape — bare
wps:wspwithout text body - Word Reference
Based on OfficeCLI v1.0.97