Author Topic: Firing Visio events?  (Read 8014 times)

0 Members and 1 Guest are viewing this topic.

Nikolay

  • Hero Member
  • *****
  • Posts: 1126
    • UnmanagedVisio
Firing Visio events?
« on: June 09, 2010, 04: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.

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3301
    • Paul Herber's website
Re: Firing Visio events?
« Reply #1 on: June 09, 2010, 04: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

Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

Nikolay

  • Hero Member
  • *****
  • Posts: 1126
    • UnmanagedVisio
Re: Firing Visio events?
« Reply #2 on: June 09, 2010, 09:18:02 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