Run Property

Microsoft PowerPoint Visual Basic

Returns or sets the name of the presentation or macro to be run when the specified shape is clicked or the mouse pointer passes over the shape during a slide show. The Action property must be set to ppActionRunMacro or ppActionRunProgram for this property to affect the slide show action. Read/write String.

Remarks

If the value of the Action property is ppActionRunMacro, the specified string value should be the name of a global macro that's currently loaded. If the value of the Action property is ppActionRunProgram, the specified string value should be the full path and file name of a program.

You can set the Run property to a macro that takes no arguments or a macro that takes a single Shape or Object argument. The shape that was clicked during the slide show will be passed as this argument.

Example

This example specifies that the CalculateTotal macro be run whenever the mouse pointer passes over the shape during a slide show.

With ActivePresentation.Slides(1) _
    .Shapes(3).ActionSettings(ppMouseOver)
        .Action = ppActionRunMacro
        .Run = "CalculateTotal"
        .AnimateAction = True
End With