Visio Guy

Visio Discussions => Programming & Code => Topic started by: Nikolay on June 09, 2010, 09:05:24 AM

Title: Firing Visio events?
Post by: Nikolay on June 09, 2010, 09:05:24 AM
Hello guys,
Please can somebody give me a good advice here?

Suppose we have a Visio add-in that renames shapes. When we run this add-in (e.g. by clicking some custom button), it renames some shape on the current page. Now suppose that we also have another "3-rd party" add-in (or a custom, user-defined, VBA code in a stencil or in the diagram) that listens to "shape renamed" (TextEdit) event. This event is not fired if shape text is changed programmatically; this means other add-ins (or user VBA code) will not get notification about shape text change. How do I fire (or, better, force Visio to fire) a "TextEdit" event so these 3-rd party add-ins or 3-rd party VBA code will be "aware" of this change?

Actually "TextChange" event is just an example here; I'm also interested in a "generic" case.
Thanks, Nikolay.
Title: Re: Firing Visio events?
Post by: Paul Herber on June 09, 2010, 09:48:07 AM
Hi Nikolay,
I've had no trouble with this, I can do it right now, one addon listening to the shapeAdded event and one dropping a shape. Works.
These are both .vsl addins so may be different to your case.

P.S. shape renamed != Text edit

Title: Re: Firing Visio events?
Post by: Nikolay on June 09, 2010, 02:18:02 PM
Quote from: Paul Herber on June 09, 2010, 09:48:07 AM
Hi Nikolay,
I've had no trouble with this, I can do it right now, one addon listening to the shapeAdded event and one dropping a shape. Works.
These are both .vsl addins so may be different to your case.

P.S. shape renamed != Text edit

Hi Paul,

Thanks, yep, indeed it does work for "ShapeAdded" and "ShapeDeleted" events.
But still, any suggestions for the "share text edit"? ("ShapeExitedTextEdit" event, to be precise...)

P.S. Yes, I know that shape renamed != Text edit, I meant the "text edit" exactly