-
Notifications
You must be signed in to change notification settings - Fork 528
word paragraph add
zmworm edited this page May 24, 2026
·
53 revisions
Add a paragraph to the document body, headers, footers, or table cells.
Parent: /body, /header[N], /footer[N], table cells
| Property | Default | Description |
|---|---|---|
text |
(empty) | Paragraph text |
style |
- | Style ID (e.g., Heading1, Normal) |
alignment |
- |
left, center, right, justify
|
font, size, bold, italic, color
|
- | Text formatting |
listStyle |
- |
bullet, numbered, none
|
start |
- | List start number |
numId, numLevel
|
- | Numbering definition |
listLevel/level
|
- | List nesting level (0-based) |
firstLineIndent |
- | First line indent (inches) |
leftIndent/indentLeft/indent, rightIndent/indentRight, hangingIndent
|
- | Indents (twips) |
spaceBefore, spaceAfter, lineSpacing
|
- | Spacing |
shading/shd
|
- | Background (fill or val;fill or val;fill;color) |
underline, strike/strikethrough, highlight
|
- | Text decoration |
caps, smallCaps
|
- | Capitalization |
superscript, subscript
|
- | Vertical alignment |
keepNext, keepLines, pageBreakBefore, widowControl
|
- | Flow control |
outlineLvl |
- | Outline level (0–9 maps to TOC depth; 9 hides from TOC) |
rStyle |
- | Run style ID applied to the paragraph's implicit run rPr (so visible text doesn't fall back to Normal) |
firstLineChars / leftChars / rightChars / hangingChars
|
- | Char-based indents (1/100ths of a CJK character) — companion to twip-based indents |
framePr.* |
- | Text-frame properties (<w:framePr>): framePr.w, framePr.h, framePr.x/framePr.xAlign, framePr.y/framePr.yAlign, framePr.wrap, framePr.hAnchor/framePr.vAnchor, framePr.lines, framePr.dropCap. Used by drop-caps and floating-paragraph layouts. |
tabs |
shorthand string | Tab-stop shorthand: pos1[:align[:leader]],pos2[...] (e.g. tabs=2cm,4cm:right:dot). Replaces the verbose tabs[N].* form. ST_OnOff values like 1/true normalized consistently. |
wordWrap |
- | Toggle <w:wordWrap/> (allow Latin words to wrap mid-word in CJK paragraphs). Mirrors Set behavior. |
direction / dir
|
- | Reading direction: rtl/ltr — see i18n
|
font.latin / font.ea / font.cs
|
- | Per-script font slots — see i18n |
bold.cs / italic.cs / size.cs
|
- | Complex-script bold/italic/size (Arabic/Hebrew) |
pbdr.* |
- | Paragraph borders (style;size;color;space), supports .top, .bottom, .left, .right, .between, .bar, .all
|
# Add a heading officecli add report.docx /body --type paragraph --prop text="Chapter 1" --prop style=Heading1 # Add body text officecli add report.docx /body --type paragraph --prop text="This is body text." --prop font=Arial --prop size=12 # Add a bulleted list item officecli add report.docx /body --type paragraph --prop text="First item" --prop listStyle=bullet # Add a numbered list starting at 5 officecli add report.docx /body --type paragraph --prop text="Step five" --prop listStyle=numbered --prop start=5 # Insert at a specific position (0-based) officecli add report.docx /body --type paragraph --prop text="Inserted paragraph" --index 0 # Add centered paragraph with background officecli add report.docx /body --type paragraph --prop text="Notice" --prop alignment=center --prop shd=FFFF00
Based on OfficeCLI v1.0.97