Replace text Version 2 (Net)
Action group: Word
Description
The action replaces all occurrences of a string in the document with another string.
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
Context | Action context for working with a Word document. | Robin.Word | Word context | Yes |
Replace | Text to be replaced. The maximum text length is 254 characters. | Robin.String | Yes | |
To | The new value for the text to be replaced. The maximum text length is 254 characters. | Robin.String | Yes | |
Replace match | Selecting the appropriate value will replace all matches or just the first one. | Robin.String | Yes |
Special conditions of use
In protected documents, the action works only on unlocked fields.
Example of use
Task
There is a Word-document with the text of names. It is necessary to replace the name Alex with Petr (all matches).
Solution
Use the actions "Open document", "Replace text", "Save as".
Implementation
- Assemble a robot scheme consisting of actions:
- Set the parameters for the "Open" action.
In the "Path to file " field specify the path where the required file is located;
In the "Visible" field set checkbox = true to open the file in visible mode. - Set parameters for the "Replace text" action.
In the "Context" field specify the context of the opened document;
In the "Replace" field specify the value in the text to be changed;
In the "To" field, specify the value to replace the specified text with;
In the "Replace match" field specify the value - All matches. - Set parameters for the "Save As" action.
Specify the context of the document in the "Word-document" field. The document will be saved. - Launch the robot using the "Start" button in the top panel.
Result
The program robot completed successfully. The required text has been replaced.
Обзор
Инструменты контента