Document.VBProjectData property (Visio)

Returns the Microsoft Visual Basic project data stored with a document. Read-only.

Syntax

expression.VBProjectData

expression A variable that represents a Document object.

Return value

Byte()

Example

Use the VBProjectData property to determine whether a document has a project. The following macro shows how to get a reference to a document in Microsoft Visio to determine whether the document has a project. The code runs from a program outside the Visio document.

Private Sub Form_Load() 
 
 'Declare document variable 
 'and Array variable to hold project data. 
 Dim vsoDocument As Visio.Document 
 Dim btProjectData() As Byte 
 
 'Get the first object in the Documents collection 
 'of this instance of Visio. 
 Set vsoDocument = GetObject(, "Visio.Application").Documents(1) 
 
 'Populate the array with project data. 
 btProjectData = vsoDocument.VBProjectData 
 Debug.Print LBound(btProjectData); UBound(btProjectData) 
 
End Sub

If the document had no project associated with it, "0 -1" would be reported in the Immediate window. If the document had a project, the upper bound would be some number greater than zero (0). For example, "0 1535" would indicate that a project had 1,536 bytes of data.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.