Skip to content

command view word

zmworm edited this page Mar 21, 2026 · 51 revisions

view - Word (.docx)

View modes for Word documents.

text

Plain text content with element paths.

Output format:

[/body/p[N]] text content
[/body/p[N]] • bulleted item (list prefix)
[/body/tbl[N]] [Table: {rows} rows]
[/body/oMathPara[N]] [Equation] readable math text
... (showed {N} rows, {total} total, use --start/--end to view more)

Example output:

[/body/p[1]] Complex Math Formula Collection
[/body/p[2]] I. Algebra
[/body/oMathPara[1]] [Equation] x = (-b ± √(b² - 4ac)) / 2a
[/body/p[3]] This is regular text.
[/body/tbl[1]] [Table: 5 rows]

annotated

Text with formatting details. Shows style, font, size for each run. Equations shown as LaTeX.

Output format:

[/body/p[N]] 「text content」 ← StyleName | FontName, 12pt, bold, italic
[/body/p[N]] [] <-- empty paragraph
[/body/p[N]] [Equation: "LaTeX formula"] ← display
[/body/p[N]] [Equation: "LaTeX formula"] ← StyleName | inline
[/body/p[N]] [Image: description] ← StyleName
[/body/tbl[N]] [Table: {rows}×{cols}]

Example output:

[/body/p[1]] 「Chapter 1」 ← Heading1 | Arial, 16pt, bold
[/body/p[2]] 「This is body text.」 ← Normal | Calibri, 11pt
[/body/p[3]] [] <-- empty paragraph
[/body/p[4]] [Equation: "\frac{-b \pm \sqrt{b^{2}-4ac}}{2a}"] ← display
[/body/tbl[1]] [Table: 3×4]

Fields:

  • [/body/p[N]] — Element path (usable with get/set/remove)
  • 「text」 — Run text content (in corner brackets)
  • ← StyleName — Paragraph style
  • | FontName, size, bold, italic — Run formatting (comma-separated modifiers)
  • [Equation: "..."] — LaTeX formula
  • [Image: ...] — Image with description
  • [Table: rows×cols] — Table dimensions

outline

Document structure: file stats, watermark, headers/footers, heading hierarchy.

Output format:

File: {filename} | {N} paragraphs | {N} tables | {N} images | {N} equations
Watermark: "{text}"
Header: "{text}"
Footer: "{text}"

├── [N] "Heading text" (Heading1)
  ├── [N] "Sub-heading" (Heading2)
    ├── [N] "Sub-sub-heading" (Heading3)
■ [N] "Title text" (Title)

stats

Style and font usage statistics.

Output format:

Paragraphs: {N} | Total Characters: {N}

Style Distribution:
  Normal: {count}
  Heading1: {count}
  ...

Font Usage:
  Calibri: {count}
  Arial: {count}
  ...

Font Size Usage:
  11pt: {count}
  14pt: {count}
  ...

Empty Paragraphs: {count}
Consecutive Spaces: {count} occurrences

issues

Formatting/content/structure problems. Grouped by category.

Output format:

Found {N} issue(s):

Structure Issues ({count}):
  [S1] /body/p[5]: Empty paragraph

Format Issues ({count}):
  [F1] /body/p[3]: Body paragraph missing first-line indent

Content Issues ({count}):
  [C1] /body/p[7]: Consecutive spaces
       Context: "word  word"
       Suggestion: Merge into a single space
  [C2] /body/p[8]: Duplicate punctuation
  [C3] /body/p[9]: Mixed CJK/Latin punctuation

Issue fields:

  • Id — Identifier (S=Structure, F=Format, C=Content + number)
  • Path — Element path
  • Message — Problem description
  • Context — Surrounding text (optional)
  • Suggestion — How to fix (optional)

Issue types for --type filter: format/f, content/c, structure/s

Examples

officecli view report.docx text
officecli view report.docx text --start 1 --end 50
officecli view report.docx text --max-lines 100
officecli view report.docx annotated
officecli view report.docx outline
officecli view report.docx stats
officecli view report.docx issues
officecli view report.docx issues --type format --limit 10
officecli view report.docx text --json

See Also


Based on OfficeCLI v1.0.11

Clone this wiki locally