Skip to content

Word Read Paragraphs

Type: word-read-paragraphs  ·  Package: Word Activities v1.0.4  ·  Output: List<object>

Reads all the paragraphs of a document and returns them as a list of strings (one per paragraph). Useful when you want to process the document paragraph by paragraph instead of as a single block of text.

Goes through the paragraphs of the document body, in order, and returns the full text of each one. By default it skips empty paragraphs (includeEmpty = false). It accepts session or path — see the two modes; with path it opens the file, reads it and closes it without changes.

  • Scope: only the body paragraphs. Text inside tables is not included (read it with Word Read Tables), nor headers or footers.
  • A paragraph that only has spaces is not considered empty and is included.
  • includeEmpty is set in the editor; it does not accept expressions.

None — but you must provide session or path.

ParameterTypeDefaultDescription
sessionZoanWordSession—Session from Word Open (instead of path). Inherited automatically inside a body.
pathstring—Path to the .docx (quick mode). Only used when there is no session.
includeEmptyboolfalseInclude empty paragraphs (useful if you need to keep each paragraph’s position).

Returns a List of strings (string), one item per paragraph in document order. A document with no paragraphs with text returns an empty list. Loop over it with For Each.

Word Read Paragraphs path = asset("minutes.docx") → output: paragraphs
For Each items = paragraphs itemVariable = p
└─ activities:
If condition = startsWith(str(p), "RESOLUTION")
└─ then:
Log message = p
MessageCause and fix
'session' or 'path' is required.There is no session and no path.
File not found.The path does not exist on the robot’s machine.