Creating an Event Sink for Visio Objects

To use the event model, you first need to create a sink object if you are going to send notifications to your add-on (see Figure 18.2). Running add-ons in response to events does not require a sink object. The event sink is an instance of a class module for which you have defined the VisEventProc method. Whether you plan to send event notifications or run add-ons, you next need to get a reference to the Visio source object and hold on to it. Usually, this reference is a global variable. If your add-on releases this reference (the Object goes out of scope), event handling will cease.

Figure 18.2. Event object model flow.

Besides the normal collection properties and methods (Item, Count, and so on), the ...

Get Professional Development with Visio® 2000 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.