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

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for working with a Word document.Robin.WordWord contextYes
ReplaceText to be replaced. The maximum text length is 254 characters.Robin.String
Yes
ToThe new value for the text to be replaced. The maximum text length is 254 characters.Robin.String
Yes
Replace matchSelecting 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

  1. Assemble a robot scheme consisting of actions:
  2. 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. 
  3. 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. 

  4. Set parameters for the "Save As" action. 
    Specify the context of the document in the "Word-document" field. The document will be saved. 
  5. Launch the robot using the "Start" button in the top panel. 

Result

The program robot completed successfully. The required text has been replaced. 

  • Нет меток