Run 方法

       

运行指定的 Microsoft Visual Basic 宏。使用 Run 方法可以在 Microsoft FrontPage 中执行指定过程。还可以在 ActiveX 控件(执行指令以查询或修改基于 FrontPage 的站点)的过程内使用 Run 方法。

注意  不能使用 Run 方法将参数传递给过程。若要将参数传递给过程,请使用 Call 语句。

expression.Run(MacroName, safeArrayOfParams)

expression  返回 Application 对象的表达式。

MacroName  必选,String 类型。宏、加载项或脚本的名称。

safeArrayOfParams  必选。Variant 类型的 ParamArray

示例

本示例从其他过程运行宏。

注意  若要运行本示例,必须有一个称为 Rogue Cellars 的站点,或者也可以用另一个站点来代替 Rogue Cellars 站点。将下列过程复制到代码模块中并运行 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