3 4
The Microsoft Visio type library contains descriptions of the objects, methods, properties, events, and constants that the Visio engine exposes. You use the Visio type library to define Visio object types and constants in your program. Using Visio object types enables early binding and increases the speed of your program.
When programming with Visio 4.5 or later, you can set a reference to the Visio type library. To set a reference to the Visio type library in Microsoft Visual Basic, click References on the Project menu, and select the Microsoft Visio 2002 type library in the Available References list.
The Visio type librarycontains global symbolic constants defined for arguments and return values of properties and methods. Most arguments for properties and methods are numeric values. Using symbolic constants can make your code easier to both write and read.
For example, suppose you want to find out what type of window a Window object represents. The Type property of a Window object returns an integer that indicates the window's type. For example, if you set a reference to the Visio type library in your project, you can use the constant visDrawing, instead of 1, to check the window's type.
For a list of constants used by a particular method or property, look up the property or method in the Microsoft Visio Developer Reference (on the Help menu, click Developer Reference).
Note
If you use Visconst.bas instead of the Visio type library for some of your solution code, you cannot use Visio object types—you must use the generic Object variable type. For example, when defining variables, you must use Dim docsObj As Object, and not Dim docsObj As Visio.Documents. The constants in Visconst.bas are grouped by usage.