Replace image Version 1 (Python)
Action group: Office
Description
The action replaces an image with another image
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Context | Context for working with a document | Robin.OpenTextDo c | Yes | |
Replace | The image in the document to be replaced. The order starts from 1. The default value is 1 | Robin.Numeric | Yes | |
On | New image | Robin.FilePath | Yes | |
Width | The width of the image to be added | Robin.Numeric | No | |
Height | The height of the image to be added. Ignored if the «Width» parameter is not specified | Robin.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
- Assemble a robot scheme consisting of the actions: "Open", '"Replace image", "Save", "Close".
- Set the "Open" action parameter.
In the "Path to file" field specify the path to the file test.docx - 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. - Move the "Save" action to the workspace and set its parameter.
In the context field specify the context of the open document. - Move the "Close" action to the workspace and set its parameter.
- 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.
Обзор
Инструменты контента