VBE 属性

       

返回 VBE 对象,该对象代表 Visual Basic 编辑器。

expression.VBE

expression  必选。返回 Application 对象的表达式。

示例

下列示例创建对 Visual Basic 编辑器的引用,并向用户显示活动项目的名称。

Sub ReturnVBE()
'Creates a reference to the VBE and displays a message to user

    Dim objApp As FrontPage.Application
    Set objApp = FrontPage.Application
    'Display the name of the active project
    MsgBox "The name of the active project is: " & _
            objApp.VBE.ActiveVBProject.Name

End Sub