VBProject property

Microsoft Visio Developer Reference

VBProject property

       

Returns a programmable object through which the Microsoft Visual Basic for Applications (VBA) project of the document can be controlled.

Version added

4.5

Syntax

objRet = object.VBProject

objRet

Programmable object that exposes methods and properties of the document's VBA project.

object

Required. An expression that returns a Document object.

Remarks

To get information about the object returned by the VBProject property:

  1. On the Tools menu, point to Macros, and then click Visual Basic Editor.
  1. In the Visual Basic Editor, on the Tools menu, click References.
  1. In the References dialog box, click Microsoft Visual Basic for Applications Extensibility, and then click OK.
  1. On the View menu, click Object Browser.
  1. In the Project/Library list, select the VBIDE type library.
  1. In the Classes list, examine the class named VBProject.

Beginning with Microsoft Visio 2002, the VBProject property raises an exception if you are running in a secure environment and your system administrator has blocked access to the Visual Basic object model. There is no user interface or programmatic way to turn this on—the system administrator must turn on (or off) access via a Group Policy. This is a protection mechanism against viruses that spread by accessing the Visual Basic projects in commonly used templates and injecting the virus code into them.