DocumentBase.VBProject Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the Microsoft.Vbe.Interop.VBProject for the document.
public Microsoft.Vbe.Interop.VBProject VBProject { get; }
Property Value
- Microsoft.Vbe.Interop.VBProject
The Microsoft.Vbe.Interop.VBProject for the document.
Examples
The following code example uses the VBProject property to display the name of the Visual Basic for Applications project for the document. To use this example, run it from the ThisDocument class in a document-level project.
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
Remarks
Use this property to gain access to code modules and user forms.