Share via


VBProjectData Property [Visio 2003 SDK Documentation]

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

valRet = object**.VBProjectData**

valRet     Byte. An array of data stored with a document's Visual Basic project.

object     Required. An expression that returns a Document object.

Version added

2002

Example

You can 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 Office Visio to determine whether the document has a project. The code runs from a program outside of 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.

Applies to | Document object