Skip to content

Word Append Paragraph

Type: word-append-paragraph  ·  Package: Word Activities v1.0.4

Appends a paragraph to the end of the document, with an optional style. It is the basic building block for documents: the title, section headings and body text.

Adds text as a new paragraph at the end of the document body, applying the given style (see styles). It only works inside a session (Word Create or Word Open); the change stays in memory until the document is saved.

  • The text is written as is, spaces included. An empty text adds a blank paragraph.
  • The style is assigned by its identifier (Heading1, Title…). The final look depends on the document defining that style: documents made in Word include it; in a document without that style defined, the paragraph shows with normal formatting. For controlled formatting, start from a template opened with Word Open.
  • style is picked from the list; it does not accept expressions.
ParameterTypeDefaultDescription
textstring—The paragraph text. Supports expressions.
ParameterTypeDefaultDescription
sessionZoanWordSession—Word session. Inherited automatically inside a body.
stylestring"Normal"Paragraph style: Normal · Title · Heading1 · Heading2 · Heading3.

This activity does not return a value.

Word Open path = asset("report_template.docx")
└─ body:
Word Append Paragraph text = "Audit Report" style = Title
Word Append Paragraph text = "1. Summary" style = Heading1
Word Append Paragraph text = "We reviewed " + total + " records."
Word Save path = "C:/reports/report.docx"
MessageCause and fix
'session' must be a valid Word session (use word-open or word-create).The activity is outside a Word Create/Word Open body and got no session.