Вы просматриваете старую версию данной страницы. Смотрите текущую версию.

Сравнить с текущим просмотр истории страницы

« Предыдущий Версия 3 Следующий »

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

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

Свойство

Описание

Тип

Пример заполнения

Обязательность

заполнения поля

Параметры

Контекст

Экземпляр Word-документа, к которому будет применено действие.

Robin.Word

Контекст Word-документа

Да

Название закладки

Название закладки, указывающей начало форматирования. Будет изменен весь текст от закладки и до конца документа или до начала следующей закладки при ее наличии. Если в закладке указан точный отрывок текста, к которому она относится, то изменен будет только этот текст. Можно указать сразу несколько закладок, указав каждое название через ";". Если закладка не будет указана, то форматирование применится ко всему документу.

Robin.String

Закладка1;Закладка2

Нет

Убрать форматированиеЕсли значение "true", то с указанного текста снимается форматирование. Цвет текста станет черным, снимется выделение, курсив, полужирность и подчеркивание.Robin.BooleantrueНет
Полужирный

Если значение "true", то шрифт текста станет полужирным.

Robin.BooleantrueНет
Курсив

Если значение "true", то шрифт текста станет курсивным.

Robin.BooleantrueНет
ПодчеркнутыйЕсли значение "true", то указанный текст подчеркивается.Robin.BooleantrueНет
Размер текстаРазмер шрифта текста, который будет установлен для указанного текста. Размер может быть в диапазоне от 1 до 1638 и кратен 0.5.Robin.Numeric12,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

  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:

  • Нет меток