Run Method

Applies To

Application object, SlideShowSettings object.

Description

Application object: Runs a Visual Basic procedure.

SlideShowSettings object: Runs a slide show of the specified presentation. Returns a SlideShowWindow object.

Syntax 1

expression.Run(MacroName, safeArrayOfParams)

Syntax 2

expression.Run

expression Required. An expression that returns an Application object (Syntax 1) or a SlideShowSettings object (Syntax 2).

MacroName Required String. The name of the procedure to be run. The string can contain the following: a loaded presentation or add-in file name followed by an exclamation point (!), a valid module name followed by a period (.), and the procedure name. For example, the following is a valid MacroName value: "MyPres.ppt!Module1.Test."

safeArrayOfParams Required Variant. The argument to be passed to the procedure. You cannot specify an object for this argument, and you cannot use named arguments with this method. Arguments must be passed by position.

Remarks

To run a custom slide show, set the RangeType property to ppShowNamedSlideShow, and set the SlideShowName property to the name of the custom show you want to run.

Example

This example starts a full-screen slide show of the active presentation, with shortcut keys disabled.

With ActivePresentation.SlideShowSettings
    .ShowType = ppShowSpeaker
    .Run.View.AcceleratorsEnabled = False
End With
This example runs the named slide show "Quick Show."

With ActivePresentation.SlideShowSettings
    .RangeType = ppShowNamedSlideShow
    .SlideShowName = "Quick Show"
    .Run
End With
In this example, the Main procedure defines an array and then runs the macro TestPass, passing the array as an argument.

Sub Main()
    Dim x(1 To 2)
    x(1) = "hi"
    x(2) = 7
    Application.Run "TestPass", x
End Sub

Sub TestPass(x)
    MsgBox x(1)
    MsgBox x(2)
End Sub