Skip to content

Word Action ​

Performs a selected operation on a Microsoft Word document, such as inserting or replacing content, manipulating tables, managing images, or extracting text.

Purpose ​

Use this task to automate modifications to Word documents during a workflow. The operation to perform is controlled by the Action selector, and additional inputs become visible based on the selected action. This task supports a broad range of document manipulation scenarios, from simple text replacement to bulk table population and image management.

Inputs ​

FieldTypeRequiredDescription
ActionDropdownYesThe Word operation to perform.
Document PathTextYesFull path to the target Word document on the server.
Insert TextMulti-line TextNoText to insert as a new paragraph. Visible when Action is InsertParagraph.
Insertion MarkerTextNoLocation marker for insertion (e.g. AtEnd, BeforeBookmark:Name, Paragraph:5). Visible when Action is InsertParagraph, InsertImage, or CreateTable.
Replacement PatternsKey-Value PairsNoDictionary of search patterns (keys) and replacement text (values). Visible when Action is ReplaceText.
Use RegexCheckboxNoTreat search patterns as regular expressions. Visible when Action is ReplaceText or FindAndHighlightText.
Search PatternTextNoText or regex pattern to find. Visible when Action is FindAndHighlightText.
Highlight ColorTextNoColor to apply to matched text (e.g. yellow, green). Visible when Action is FindAndHighlightText.
Target Paragraph IdentifierTextNoParagraph number or bookmark name to delete. Visible when Action is DeleteParagraph.
Image PathTextNoLocal path or URL to the image file. Visible when Action is InsertImage or ReplaceImage.
Target Image IdentifierTextNoImage filename, alt text, or index to replace or delete. Visible when Action is ReplaceImage or DeleteImage.
Image WidthTextNoDesired image width. Visible when Action is InsertImage or ReplaceImage.
Image HeightTextNoDesired image height. Visible when Action is InsertImage or ReplaceImage.
Number of RowsTextNoNumber of rows for the table. Visible when Action is CreateTable or BulkPopulateTable.
Number of ColumnsTextNoNumber of columns for the table. Visible when Action is CreateTable or BulkPopulateTable.
Table IdentifierTextNoTable index or bookmark name. Visible when Action is AddTableRow, DeleteTableRow, or BulkPopulateTable.
Row Values (Comma-Separated)Multi-line TextNoComma-separated values for the new row. Visible when Action is AddTableRow.
Row IndexTextNoZero-based index of the row to delete. Visible when Action is DeleteTableRow.
Table Data (JSON)Multi-line TextNoJSON array of arrays representing table rows and columns. Visible when Action is BulkPopulateTable.
PDF Output PathTextNoFile path where the exported PDF will be saved. Visible when Action is SaveAsPDF.
Extract Range MarkerTextNoRange to extract (e.g. All, Bookmark:Name, Paragraph:5-10). Visible when Action is ExtractText.

Visibility Rules ​

All inputs except Action and Document Path are conditional. Each input is shown only when the relevant Action value is selected, as indicated in the Description column above.

Operations ​

OperationDescription
InsertParagraphInserts a new paragraph at the specified marker location.
ReplaceTextReplaces text throughout the document using a dictionary of find-and-replace pairs.
DeleteParagraphRemoves the paragraph identified by number or bookmark.
InsertImageInserts an image at the specified marker location.
ReplaceImageReplaces an existing image identified by name, alt text, or index.
DeleteImageDeletes an image identified by name, alt text, or index.
CreateTableCreates a new table with the specified dimensions at the marker location.
AddTableRowAppends a row of comma-separated values to the specified table.
DeleteTableRowDeletes the row at the specified zero-based index from the specified table.
BulkPopulateTablePopulates a table with a 2D JSON array of row and cell values.
ExtractTextExtracts text from the specified range and returns it as the Result output.
FindAndHighlightTextHighlights all matches of a search pattern with the specified color.

Outputs ​

NameDescription
ResultThe result of the operation. Returns OK for most actions, extracted text for ExtractText, or the output file path for SaveAsPDF.

Tentech