-
Notifications
You must be signed in to change notification settings - Fork 518
word paragraph add
zmworm edited this page May 5, 2026
·
52 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 |
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=FFFF00Based on OfficeCLI v1.0.73