共用方式為


DocumentBase.VBProject 屬性

定義

取得文件的 Microsoft.Vbe.Interop.VBProject。

public:
 property Microsoft::Vbe::Interop::VBProject ^ VBProject { Microsoft::Vbe::Interop::VBProject ^ get(); };
public Microsoft.Vbe.Interop.VBProject VBProject { get; }
member this.VBProject : Microsoft.Vbe.Interop.VBProject
Public ReadOnly Property VBProject As VBProject

屬性值

文件的 Microsoft.Vbe.Interop.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 

備註

使用這個屬性來取得程式代碼模組和用戶表單的存取權。

適用於