Append Paragraph Activity
The Append Paragraph activity adds text to a Microsoft Word document. It can insert new paragraphs or append text to the beginning or end of an existing paragraph within a specified Word file. This activity facilitates dynamic content generation in Word documents.
| Field | Description | Requirement |
|---|---|---|
| Word Name | Specifies the reference name of the already opened or created Word file. | Required |
| Text | Defines the text to be inserted into the paragraph. | Required |
| Position | Specifies the 0-based index of the paragraph where the text should be inserted. If null or -1, the text is appended to the end of the document. If 0, the text is inserted at the beginning of the document. Otherwise, it is inserted after the specified paragraph index. | Optional |
Action Types & Examples
Word Name
- Format: string
- Example Result:
newWord
Text
- Format: string
- Example Result:
"Hello World"
Position
- Format: integer
- Example Result:
1
Implementation Examples
Field Setup - Word Name: myDocumentHandle - Text: "This is a new paragraph." - Position: 2
Execution Parameters - To append simple text: - Word Name: reportFile - Text: "Summary of findings for Q3." - Position: -1 - To insert text from a variable at the beginning: - Word Name: templateDoc - Text: introductionVariable - Position: 0 - To add text after a specific paragraph: - Word Name: contractDraft - Text: "Additional clause added as per amendment." - Position: 5
Technical Notes
If the
Positionparameter is left empty or set to-1, the text is appended to the end of the document. SettingPositionto0inserts the text at the very beginning of the document. ThePositionparameter refers to the paragraph index within the Word document, not a page number.