Skip to content

Word Action Node

The Word Action node allows automation tasks to interact with Microsoft Word documents. A variety of operations can be performed, such as inserting text, replacing content, modifying tables, inserting/deleting images, and exporting to PDF. This node is useful for generating or modifying templated documents during a workflow execution.

Node Type

  • Type: task
  • TaskType: Word Action
  • Icon: mdi mdi-file-word-box

Summary

This task executes Word document manipulations based on the selected Action. It supports text operations, image manipulations, table editing, and document extraction/formatting features.


Inputs

LabelTypeRequiredVisible WhenDescription
Document Pathtext*Full path to the Word document to operate on.
Actionpicklist*The action to perform. See Actions.

Additional inputs become visible depending on the selected Action.


Available Actions and Required Inputs

Below are the supported Action values and the required inputs for each:

InsertParagraph

InputTypeDescription
Insert TexttextText to insert into the document.
Insertion MarkertextA marker in the document used to place the text.

ReplaceText

InputTypeDescription
Search PatterntextText or regex pattern to search for.
Replacement TexttextText to replace matched content.
Use Regextext(Optional) Boolean true/false to use regular expressions.

DeleteParagraph

InputTypeDescription
Target Paragraph IdentifiertextA unique string identifying the paragraph to remove.

InsertImage

InputTypeDescription
Image PathtextFile path of the image to insert.
Insertion MarkertextLocation in the document to insert the image.

ReplaceImage

InputTypeDescription
Target Image IdentifiertextIdentifier or index of the image to replace.
Image PathtextPath to the new image file.

DeleteImage

InputTypeDescription
Target Image IdentifiertextIdentifier or index of the image to delete.

CreateTable

InputTypeDescription
Number of RowstextNumber of rows to create. Must be an integer.
Number of ColumnstextNumber of columns to create. Must be an integer.
Insertion MarkertextPosition in the document to insert the table.

AddTableRow

InputTypeDescription
Table IdentifiertextIdentifier of the target table.
Row Values (Comma-Separated)textComma-separated values for the new row.

DeleteTableRow

InputTypeDescription
Table IdentifiertextIdentifier of the table.
Row IndextextIndex (starting at 0) of the row to delete.

BulkPopulateTable

InputTypeDescription
Table IdentifiertextIdentifier of the target table.
Table Data (JSON)textJSON-formatted 2D array of table rows and cells. Example: [[ "Cell 1", "Cell 2" ], [ "Cell 3", "Cell 4" ]]

SaveAsPDF

InputTypeDescription
PDF Output PathtextFull path to output the generated PDF file. (Note: PDF conversion logic is currently commented out in backend. Ensure implementation exists.)

ExtractText

InputTypeDescription
Extract Range MarkertextMarker used to extract text from the document.

FindAndHighlightText

InputTypeDescription
Search PatterntextText or regex pattern to search.
Highlight ColortextColor to use for highlighting (e.g., yellow, blue).
Use RegextextOptional boolean flag to enable regex matching.

Outputs

NameDescription
ResultThe result of the operation. May return OK, extracted text, or file path depending on the action.

Notes

  • This node assumes the file exists at the provided path and that the necessary markers or identifiers are correctly configured within the Word document.
  • For advanced functionality like PDF generation, ensure the corresponding backend method (SaveAsPdf) is fully implemented.
  • Ensure all file paths are accessible on the execution server.

Tentech 2024