Set bookmark Version 1 (Python)
Action group: Office
Description
The action sets a bookmark in the document
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Context | Context for working with a document | Robin.OpenTextDo c | Yes | |
Bookmarks name | The name of the bookmark to be added to the document. Bookmark names must start with a letter. They can contain numbers and letters, but not spaces. | Robin.String | Yes | |
Insertion text | The text relative to the position of which the bookmark will be added | Robin.String | Yes | |
Add text to | The location of the bookmark relative to the specified text. The bookmark will be added on the first match of the text | Robin.String | Yes | |
Sequence number of the match | The ordinal number of the match of the value being searched for. If the field is empty, then the bookmark will be added by the first match of the text. Numbering starts at 1. To find the last match, you must specify -1. | Robin.Numeric | No |
Special conditions of use
None.
Example of use
Task
There is a file test (2).docx. with a list of names. You need to add a bookmark to the document after the name "Masha". Then, save the document and close it.
Solution
Use the "Open", "Set bookmark", "Save", "Close" actions.
Implementation
- Move the "Open" action to the workspace and set its parameters.
In the "Path to file" field specify the path to file test (2).docx. - Drag the "Set bookmark" action to the workspace and fill in its parameters
In the "Context" field, specify the context created in step 1.
In the "Bookmarks name" field specify the value "BookmarkTest".
In the "Insertion text" field specify the name "Masha".
In the "Add text to" field specify the value "After the specified text". - Move the "Save" action to the workspace and set its parameter.
In the context field specify the context of the open document. - Move the "Close" action to the workspace and set its parameter.
- Click "Start" in the top panel.
Result
The program robot completed successfully.
The bookmark is set to the desired location in the text. The file is saved and closed.
Обзор
Инструменты контента