Insert image Version 1 (Net)

Action group: Word


Description

The action inserts an image at the specified location in a Word-document.

You specify a Word-document, an image for insertion, and location where to add it. You can also optionally specify the size of the image and the possibility of adding it from a new line.

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextThe Word document instance to which the action will be applied.Robin.WordWord contextYes
ImageThe path to the image file to be inserted into the Word document.Robin.FilePath
Yes
HeightThe height in pixels that will be set to the specified image when pasted. Not taken into account if «Width» is not filled.Robin.Numeric
No
WidthThe width in pixels that will be set to the specified image when inserted. It is not taken into account if the «Height» is not filled in.Robin.Numeric
No
Place of additionThe location in the document where the image will be inserted.Robin.String
Yes
Bookmark nameThe name of the bookmark after which the table will be inserted.Robin.String
No
A new lineIf the value is «true», then the image will be inserted on a new line. Subsequent text in the document will also wrap to a new line.Robin.BooleantrueNo

Special conditions of use

The markup option for the inserted image is "In text":


If the place of adding after the bookmark is selected, it is necessary to specify the name of the bookmark. Otherwise, the robot will return an error.

If both bookmark name and place of addition are specified in the parameters, but the place of addition is different from "after the bookmark" then the action will ignore the bookmark name parameter.

If you select the location to add after the bookmark, but there are no bookmarks in the document, the robot will return an error.

If one of the height or width parameters is not filled in, the image will be inserted into the document at its own size.

The action does not work with locked fields in protected documents. In this case the robot will return an error.

More about bookmarks in Word: Bookmarks in Word

Example of use

Task

There is a Word-document. Insert and image after the bookmark.

The document:

Solution

Use the "Open", "Insert image", "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 "Insert image" action parameters.  In the "Context" field, specify the Word-document instance in which you want to insert the image. In the "Image" field, specify the path to the image to be inserted. In the "Height" and "Width" fields, specify the required image size. In the "Place to add" field specify "After bookmark". In the "Bookmark name" field specify the name of the existing bookmark after which the image will be inserted. In the "A new line" field check the checkbox = true.

  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 image was inserted at the specified location.

Word-document:



  • Нет меток