Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Insert header and footer Version 1 (Net)

Группа действийAction group: Word

Описание

Действие вставляет колонтитул в Word-документ.

Иконка

Image Removed

Параметры

Входные параметры

Контекст                       Контекст открытого Word-документа. Открыть Word-документ можно с помощью с действия "Открыть" (группа "Word"). 

Тип колонтитула          Тип колонтитула, который необходимо вставить. Доступно 2 варианта: Верхний, Нижний. Верхний колонтитул размещается в верхнем блоке страницы. Нижний колонтитул размещен в нижнем блоке страницы.

Текст колонтитула       Текст, который будет вписан в сам колонтитул. Если текст не указан, то в колонтитуле будет записано "[Введите текст]".

Выравнять текст по     Тип выравнивания текста в колонтитуле. Доступно 4 варианта: По левому краю, По правому краю, По центру, По ширине.

Настройки

...

Свойство

...

Описание

...

Тип

...

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

...

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

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

...

Параметры

...

Контекст

...

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

...

Robin.Word

...

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

...

Да

...

Тип колонтитула

...

Если выбран верхний колонтитул, то текст будет размещен в верхнем блоке страницы. Если выбран нижний колонтитул, то текст будет размещен в нижнем блоке страницы.

Элементы выпадающего списка:

  • Верхний
  • Нижний

...

Robin.String

...

Да

...

Тип выравнивания текста в колонтитуле. Если параметр не заполнен, текст по умолчанию будет выравнен по левому краю.

Элементы выпадающего списка:

  • Левому краю
  • Правому краю
  • Центру
  • Ширине

...

Особые условия использования 

Если в документе уже есть указанный колонтитул, то он перезапишется на новый.

Действие не работает с заблокированными полями в защищенных документах. В этом случае робот бросит ошибку.

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

Задача

Имеется Word-документ. Необходимо вставить верхний колонтитул с текстом "А.С. Пушкин" выравненным по правому краю.

Документ:

Image Removed

Решение

Воспользоваться действиями "Открыть", "Вставить колонтитул", "Сохранить как", "Закрыть". 

Реализация

...

Description

The action inserts a header and a footer in a Word-document

Action icon

Image Added

Settings of parameters

ParameterDescription
ContextThe context of an open Word-document. You can open a Word-document using the "Open document" action ("Word" action group).
Header TypeType of a header to be inserted. Two types are available: Upper, Footer. Upper header is placed in the top section of a page. Bottom header is placed in the bottom section of a page.
Header textText to be inserted in a header. If the text is not specified, the header will display a message: "[Insert text]".
Align text byThe type of text alignment in the footer. There are 4 options available: Left, Right, Center, Width.

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextThe Word document instance to which the action will be applied.Robin.WordWord contextYes
Header typeIf a header is selected, then the text will be placed in the top block of the page. If the footer is selected, then the text will be placed in the bottom block of the page.Robin.String
Yes
Header textThe text to be inserted into the header. If no text is entered in the header, it will default to «[Enter text]».Robin.String
No
Align text byThe alignment type of the text in the header. If the parameter is empty, the text will be left justified by default.Robin.String
No

Special conditions of use

If the document already has the specified header, it will be overwritten with a new one.

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. Insert an upper Header with the text "A.S. Pushkin" aligned by the right edge.

Document:

Image Added

Solution

Use the "Open document", "Insert header and footer", "Save as", "Close document" actions.

Implementation

  1. Assemble a robot scheme with the actions.
    Image Added

  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.
    Image Added

  3. Set the "Insert header and footer" action parameters. In the "Context" field specify the Word-document instance where the header needs to be inserted. In the "Header type" field select "Upper". In the "Header text" field specify text "A.S. Pushkin". In the "Align text by" field specify "Right".
    Image Added

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

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

  6. Click "Start" in the top panel to start the robot.

Result 

The program robot completed successfully. The header was inserted in the desired place.

Image Added

Word-document

...

Результат 

Программный робот отработал успешно. Изображение вставилось в указанное место.

Image Removed

Word-документ: