O'Reilly logo

Professional Development with Visio® 2000 by David Edson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

WithEvents Keyword in Visio Automation

Let's return to Automation programming again. Now that you have seen how dependencies are established, you will want to use Automation interfaces to look for dependency triggers and take appropriate action based on that trigger.

You can define a class object to receive events. A class that receives events is sometimes called an event sink or a sink object. With the class definition, you can use the VBA keyword WithEvents to declare an object variable for the Visio object whose events you want to handle.

The next three examples will show three increasing levels of complexity in utilizing WithEvents.

The first example is a binding of the object defined WithEvents within the document module. This binding keeps ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required