-
Notifications
You must be signed in to change notification settings - Fork 569
word field add
zmworm edited this page Mar 23, 2026
·
51 revisions
Insert document fields (page numbers, dates, etc.).
Type: field, also pagenum/pagenumber/numpages/date
Parent: /body/p[N] or /body
| Property | Default | Description |
|---|---|---|
instruction |
(required for field) |
Field code (e.g. " PAGE ", " NUMPAGES ", " DATE \\@ \"yyyy-MM-dd\" ") |
text |
"1" |
Placeholder display text |
font |
- | Font family |
size |
- | Font size (pt) |
bold |
- | Bold |
color |
- | Font color (hex) |
alignment |
- | Paragraph alignment (when parent is /body) |
# Insert page number field
officecli add report.docx /body/p[1] --type pagenum
# Insert page number with formatting
officecli add report.docx /body/p[1] --type pagenumber --prop font=Arial --prop size=10
# Insert total pages field
officecli add report.docx /body/p[1] --type numpages
# Insert date field
officecli add report.docx /body/p[1] --type date
# Insert date field with custom format
officecli add report.docx /body/p[1] --type field --prop instruction=" DATE \\@ \"yyyy-MM-dd\" " --prop text="2026-01-01"
# Insert field at body level (creates paragraph)
officecli add report.docx /body --type pagenum --prop alignment=center
# Custom field instruction
officecli add report.docx /body/p[1] --type field --prop instruction=" PAGE " --prop text="1" --prop bold=true --prop size=12Based on OfficeCLI v1.0.18