Replace image Version 1 (Python)

Action group: Office


Description

The action replaces an image with another image

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextContext for working with a documentRobin.OpenTextDo c
Yes
ReplaceThe image in the document to be replaced. The order starts from 1. The default value is 1Robin.Numeric
Yes
OnNew imageRobin.FilePath
Yes
WidthThe width of the image to be addedRobin.Numeric
No
HeightThe height of the image to be added. Ignored if the «Width» parameter is not specifiedRobin.Numeric
No

Special conditions of use

None.

Example of use

Task 

There is a file test.docx with an image. 
It is necessary to open the document and replace the image (the first one) with another one. Then, save the document and close it. 

Solution

Use the "Open", "Replace image", "Save", "Close" actions.

Implementation

  1. Assemble a robot scheme consisting of the actions: "Open", '"Replace image", "Save", "Close". 
  2. Set the "Open" action parameter. 
    In the "Path to file" field specify the path to the file test.docx


  3. Set the parameters for the "Replace image" action: 
    In the "Context" field specify the created context in item 1
    In the "Replace" field specify the value 1 (the first image in the document).
    In the "On" field specify the path to the image.


  4. Move the "Save" action to the workspace and set its parameter.
    In the context field specify the context of the open document.

  5. Move the "Close" action to the workspace and set its parameter.


  6. Click "Start" in the top panel.

Result

The program robot completed successfully.

The required image was replaced in the text with another image. The file is saved and closed.

  • Нет меток