Format text action
- Updated: 2026/01/13
The Format text action enables you to search for specific text in a document and then apply the available formatting options. You can then use the output variable to store the number of occurrences of the search text that were found and formatted.
Considerations
- The specified session name is invalid or does not exist.
- The page number or paragraph index specified in the search field is invalid.
- If the Word document is blank or the user running the automation does not have permission to access the document.
Settings
- Use the Session name field to specify the name of the
Word session where you want to format the text from one of the following
options:
- Session name: Enter the name that you gave the session when you opened it.
- Variable: Select the variable that you have created to store the session name.
- In the Text to format field, enter the text string that
you want to search and format.
You can enter a maximum of 256 characters.
- In the Search criteria field, select the desired check boxes to
define your search:
- Match case: Only matches with the same capitalization as find text (Case-sensitive matching).
- Match whole words: Limits the search to whole-word instances.
- Click the Range drop-down menu to specify the range
within the document to search, such as:
- Full document: Search for text from the entire
document.
This is the default setting.
- Page number: Search for text from the specified page number in the document.
- Paragraph index: Search for text from the paragraph at the specified index in the document.
- Full document: Search for text from the entire
document.
- In the Text occurrence field, click one of the following radio
buttons to select the search text occurrence:
- All: All occurrences of the text.
This is the default setting.
- First: Only the very first occurrence of the text you are searching.
- Last: Only the very last occurrence of the text you are searching.
- All: All occurrences of the text.
- (Optional) In the Font name field, enter the name of the font (for
example, Arial, Courier New, Herald, and so on) that you want to apply to the
selected text.
If you have stored the font name as a variable or global value, click the Insert a value icon to select it.
- (Optional) In the Font color field, enter the decimal value for the
font color code.
For example, if you want to change the color of the font, in the Font color field enter 51 for Blue, 87 for Green, 255 for Red, and so on.
- (Optional) In the Font size field, enter the size that you want to
apply to the selected text.
In Microsoft Word, 1 pt is the minimum and 1638 pt is the maximum font sizes you can set.
- (Optional) Select the following check boxes to apply a style to the selected text based on
your requirement:
- Font bold
- Font italic
- Font underline
Note: If you provide or set an invalid font type (name, color, size or type), the default font type that is set in the Microsoft Word application is retained. - (Optional) Click the Assigned formatted count to variable drop-down
menu to select a variable to store the number of occurrences found and
formatted.
If you have not created a variable, click the Create variable icon.