Enter text Version 8 (Net)
Action group: Word
Description
Adds text to the document.
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
Context | Unique ID of the session to which the action will be applied. | Robin.Word | Word context | Yes |
Text | Text to be added to the document | Robin.String | Yes | |
Add text to | Location in document where text should be inserted to | Robin.String | Yes | |
Bookmark name | The name of the bookmark after which the text will be added | Robin.String | No | |
On a new line | If the parameter value is true, then the specified text will be added on a new line, and the subsequent text in the document will be transferred to a new line. The default is false. | Robin.Boolean | true | No |
Special conditions of use
In protected documents, the action inserts text only into unblocked fields. To do this, set a bookmark before the unlocked field using the "Create bookmark" action, then in the "Enter text" action specify "After bookmark" in the "Add location" parameter and specify the name of the bookmark in the "Bookmark name" parameter. Thus, the text will be entered in the first unblocked field after the specified bookmark.
Example of use
Task
There is a file test (2).docx. You need to open the document and add a record = "test record" to the beginning of the document. Then, save the document and close it.
Solution
Use the action "Open document", "Enter text", "Save as", "Close document".
Implementation
- Assemble a robot scheme consisting of actions:
- Fill in the parameters for the "Open document" action.
In the "Path to file" field specify the path to the file test (2).docx - Fill in the parameters for the "Enter text" action.
In the "Context" field specify the context created in step 1.
In the "Text" field specify the value "test record".
In the "Add text to" field, specify the value "Start of Document". - Move the "Save As" action to the workspace and fill its parameter. In the "Context" field, specify the context of the open document.
- Move the "Close document" action to the workspace and fill in its parameter.
- Click on the "Start" button in the top panel.
Result
The program robot completed successfully. The required text is added to the document. The file is saved and closed.