Run macro Version 1 (Net)
Action group: PowerPoint
Description
The action launches a macro in a PowerPoint document.
The PowerPoint document and the name of the macro that is recorded in the document are specified.
A macro is a set of commands and instructions grouped together as a single command to automatically perform a task in a document.
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Document Instance | The instance of the PowerPoint document on which the macro will run. | Robin.PowerPoint | Yes | |
Macro name | The name of the macro that will run in the PowerPoint document. | Robin.String | Yes |
Special conditions of use
It is necessary to make sure that macros are enabled in the PowerPoint document. To do this, go to "Options"→"Security Control Center"→"Macro Options" and check the "Enable all macros" option and check the "Enable all macros" option:
Example of use
Task
There is a PowerPoint document. You need to launch an existing macro named Create_TextBox, which will create a new text box on the slide.
Existing macros in the PowerPoint document:
Solution
Use the actions "Open PowerPoint document", "Run macro", "Save as", "Close PowerPoint document".
Implementation
- Assemble a robot scheme consisting of actions:
- Set the parameters of the "Open PowerPoint document" action. In the "Path to file" field, specify the path to the PowerPoint document file. In the "Visible" field, set the checkbox = true.
- Set the parameters of the "Run macro" action. In the "The document instance" field specify the instance of the open document in which you want to run the macro. In the "Macro name" field specify the name of the required macro.
- Set the parameters of the "Save as" action. In the "The document instance" field specify the instance of the open document to be saved.
- Set the parameters of the "Close PowerPoint document" action. In the "The document instance" field, specify the instance of the open document to be closed.
- Start the robot using the "Start" button in the top panel.
Result
The program robot completed successfully.
PowerPoint document slide with a new text field: