Document.VBProject Property (2007 System)

Gets the Microsoft.Vbe.Interop.VBProject for the document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property VBProject As VBProject
'Usage
Dim instance As Document 
Dim value As VBProject 

value = instance.VBProject
[BrowsableAttribute(false)]
public VBProject VBProject { get; }
[BrowsableAttribute(false)]
public:
property VBProject^ VBProject {
    VBProject^ get ();
}
public function get VBProject () : VBProject

Property Value

Type: VBProject
The Microsoft.Vbe.Interop.VBProject for the document.

Remarks

Use this property to gain access to code modules and user forms.

Examples

The following code example uses the VBProject property to display the name of the Visual Basic for Applications project for the document.

This example is for a document-level customization.

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

.NET Framework Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace