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

ParameterDescription
ContextContext 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 formattingParameter, which can be used to bring the text to the classic format: black text colour without italics, bold, underline and highlighting.
BoldBold text.
ItalicsItalicizing text. 
UnderlinedUnderlining text.
Text sizeSets 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 colorSetting 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 colorText 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

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextThe Word document instance to which the action will be applied.Robin.WordWord contextYes
Bookmark nameThe 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 formattingIf 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.BooleantrueNo
BoldIf 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.BooleantrueNo
ItalicsIf the value is «true», then the font of the text will become italic.Robin.BooleantrueNo
UnderlinedIf the value is «true», then the specified text is underlined.Robin.BooleantrueNo
Text sizeThe 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 colorThe color to be set for the specified text.Robin.String
No
Text selection colorThe 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

  1. Assemble a robot scheme with the actions.


  2. 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.


  3. 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.


  4. Set the "Save as" action parameters. In the "Context" field specify the Word-document instance to be saved.


  5. Set the "Close document" action parameters. In the "Context" field specify the Word-document instance to be closed.


  6. 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:

  • Нет меток