XenoGuard Documentation

Replace

Actions » Windows » File Handling » Word » Replace

The action Replace searches a specified text in a Word document and replaces it with a new content.


[-] Hide
  1. Open the Windows node in the Workspace Explorer.
  2. Open the File Handling node.
  3. In the Word node, select the Replace action.

Parameters:

The action has the following input parameters:


NAME DESCRIPTION
Source Path Name
The path name of the source file.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Target Path Name
The path name of the target file.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Search List
The list of search items.

Parameters for the "Search List Item" sub-branch:

  • Search - the item to be searched
  • Replace - the item to be replaced
Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]

Results:

The action returns the following results:


NAME
DESCRIPTION
Result
The list of replaced items in a Word document.

Parameters of the "Result Item" sub-branch:

  • Keyword - the keyword of the replaced word or text
  • Replacement Count - the number of replaced word or text
Allowed Context Scopes [Fixed, Local, Global]
Allowed Data Types [Variable, Parameter]

Example 1 (Change abbreviated text in a document):

This example creates two local variables named, Search Text and Replace Text with Text as data type. The value of the Search Text variable is then changed with the value of Replace Text variable. After searching the document, the number of text replaced is then displayed and output via Message Box.

Example 2 (Replace multiple texts in a document):

This example searches several texts in a Word document and replaces the previous text with new values. A copy of the source file is then stored in another directory The list of replacements done in the document are iterated and displays a notice with the number of replacements done in Message Box.

See other related operations:

Insert Data
Update Data