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
Parameters
Input 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
Свойство | Описание | Тип | Пример заполнения | Обязательность заполнения поля |
Параметры | ||||
Контекст | Экземпляр Word-документа, к которому будет применено действие. | Robin.Word | Контекст Word-документа | Да |
Название закладки | Название закладки, указывающей начало форматирования. Будет изменен весь текст от закладки и до конца документа или до начала следующей закладки при ее наличии. Если в закладке указан точный отрывок текста, к которому она относится, то изменен будет только этот текст. Можно указать сразу несколько закладок, указав каждое название через ";". Если закладка не будет указана, то форматирование применится ко всему документу. | Robin.String | Закладка1;Закладка2 | Нет |
Убрать форматирование | Если значение "true", то с указанного текста снимается форматирование. Цвет текста станет черным, снимется выделение, курсив, полужирность и подчеркивание. | Robin.Boolean | true | Нет |
Полужирный | Если значение "true", то шрифт текста станет полужирным. | Robin.Boolean | true | Нет |
Курсив | Если значение "true", то шрифт текста станет курсивным. | Robin.Boolean | true | Нет |
Подчеркнутый | Если значение "true", то указанный текст подчеркивается. | Robin.Boolean | true | Нет |
Размер текста | Размер шрифта текста, который будет установлен для указанного текста. Размер может быть в диапазоне от 1 до 1638 и кратен 0.5. | Robin.Numeric | 12,5 | Нет |
Цвет текста | Цвет шрифта текста, который будет установлен для указанного текста. Элементы выпадающего списка:
| Robin.String | Красный | Нет |
Цвет выделения текста | Цвет выделения, которое будет установлено в указанном тексте. Если выбрано "Нет цвета", то выделение текста будет убрано. Элементы выпадающего списка:
| Robin.String | Желтый | Нет |
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: