DocumentBase.VBProject 属性

定义

获取文档的 Microsoft.Vbe.Interop.VBProject

public Microsoft.Vbe.Interop.VBProject VBProject { get; }

属性值

Microsoft.Vbe.Interop.VBProject

此文档的VBProject文件。

示例

下面的代码示例使用 VBProject 属性显示文档 Visual Basic for Applications 项目的名称。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。

private void DocumentVBProject()
{
    MessageBox.Show("The name of the VB project is: " +
        this.VBProject.Name);
}
Private Sub DocumentVBProject()
    MessageBox.Show("The name of the VB project is: " & Me.VBProject.Name)
End Sub 

注解

使用此属性可以访问代码模块和用户窗体。

适用于