Format text Version 1 (Net)
Action group: Word
Description
The action formats the specified text.
Specify the Word-document, bookmark name in relation to which the text will be formatted, and formatting parameters.
Action icon
Settings of parameters
Parameter | Description |
---|---|
Context | Context of an open Word-document. You can open a Word document using the "Open" action ("Word" action group). |
Bookmark name | Name of the bookmark where the text will be changed from. All text from the bookmark to the end of the document or to the beginning of the next bookmark, if any, will be changed. If a bookmark specifies the exact piece of text to which it refers, only that text will be changed. You can specify several bookmarks at once, specifying each name with ";". If no bookmark is specified, the formatting will be applied to the entire document. |
Remove formatting | Parameter, which can be used to bring the text to the classic format: black text colour without italics, bold, underline and highlighting. |
Bold | Bold text. |
Italics | Italicizing text. |
Underlined | Underlining text. |
Text size | Sets the font size of the text. The range of possible sizes is from 1 to 1638. The size must be a multiple of 0.5. |
Text color | Setting the font color of the text. There are 11 options available: Dark Red, Red, Orange, Yellow, Light Green, Green, Blue, Blue, Dark Blue, Lilac, Black. |
Text selection color | Text selection setting. There are 16 options available: No color, Yellow, Green, Turquoise, Pink, Blue, Red, Dark Blue, Blue-Green, Green, Purple, Bordeaux, Brown-Green, Gray, Light Gray, Black. |
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Context | The Word document instance to which the action will be applied. | Robin.Word | Word context | Yes |
Bookmark name | The name of the bookmark that indicates the start of formatting. All text from the bookmark to the end of the document, or to the beginning of the next bookmark, if there is one, will be changed. If the bookmark contains the exact passage of text to which it refers, then only that text will be changed. You can specify several bookmarks at once, specifying each name through «;». If the bookmark is not specified, the formatting will be applied to the entire document. | Robin.String | No | |
Remove formatting | If the value is «true», then formatting is removed from the specified text. The text color will turn black, and the selection, italics, boldness, and underlining will be removed. | Robin.Boolean | true | No |
Bold | If the value is «true», then formatting is removed from the specified text. The text color will turn black, and the selection, italics, boldness, and underlining will be removed. | Robin.Boolean | true | No |
Italics | If the value is «true», then the font of the text will become italic. | Robin.Boolean | true | No |
Underlined | If the value is «true», then the specified text is underlined. | Robin.Boolean | true | No |
Text size | The size to be set for the specified text. The size can be in the range from 1 to 1638 and is a multiple of 0.5. For example: «12.5». | Robin.Numeric | No | |
Text color | The color to be set for the specified text. | Robin.String | No | |
Text selection color | The color highlights that have been set in the specified text. If «No Color» is selected, the text selection will be deselected. | Robin.String | No |
Special conditions of use
If a non-existent bookmark name is specified, the robot will return an error.
More about bookmarks in Word: Bookmarks in Word
If text is specified but no formatting mode option is specified, the action does not change anything.
If you specify formatting parameters that are already in the text, the action will not change anything.
If an element for formatting is selected as well as the remove formatting, the robot will return an error.
If a number outside the range is specified in the font size parameter, the robot will return an error.
The action does not work with locked fields in protected documents. In this case the robot will return an error.
Example of use
Task
You have a Word-document. Set the new formatting mode to be applied to the whole document text.
Document:
Solution
Use the "Open document", "Format text", "Save as", "Close document" actions.
Implementation
- Assemble a robot scheme with the actions.
- Set the "Open document" action parameters. In the "Path to file" field specify the path to the Word-document file. In the "Visible" field check the checkbox = true.
- Set the "Format Text" action parameters. In the "Context" field, specify the Word-document instance in which you want to format the text. In the "Bold" field, specify the checkbox = true. In the "Italics" field, check the checkbox = true. In the "Underlined" field, specify the checkbox = true. In the "Text size" field specify "15". In the "Text color" field specify "Green". Specify "Yellow" in the "Text selection color" field.
- Set the "Save as" action parameters. In the "Context" field specify the Word-document instance to be saved.
- Set the "Close document" action parameters. In the "Context" field specify the Word-document instance to be closed.
- Click "Start" in the top panel to start the robot.
Result
The program robot completed successfully. The text of the entire document has been given a new formatting.
Word-document: