Run Method

       

Runs the designated Microsoft Visual Basic macro. You can use the Run method to execute a specified procedure in Microsoft FrontPage. You can also use the Run method from within the procedure of an ActiveX control that carries out instructions to query or modify a FrontPage-based web.

Note  You cannot pass parameters to a procedure using the Run method. Use the Call statement to pass parameters to a procedure.

expression.Run(MacroName, safeArrayOfParams)

expression   An expression that returns an Application object.

MacroName   Required String. The name of the macro, add-in, or script.

safeArrayOfParams   Required. A ParamArray of type Variant.

Example

This example runs a macro from another procedure.

Note   To run this example, you must have a web named Rogue Cellars or you can substitute a different web in place of the Rogue Cellars web. Copy the following procedures into a code module and run StartMacro.

Private Sub StartMacro()
    Dim myMacro As String

    myMacro = "OpenRogueCellars"
    Run (myMacro)
End Sub

Sub OpenRogueCellars()
    Dim myWeb As Web

    Set myWeb = Webs.Open("C:\My Webs\Rogue Cellars")
End Sub