Shape event semantics

J

Jumper2

I'm building a solution that deploys shapes and VBA code within a
stencil. I'd like to catch when certain shapes are deleted. It
appears that there is no way to receive BeforeShapeDelete events just
for the shapes I'm interested in, even if I explicitly AddAdvise a
handler onto the EventList of the shape.

If a user places the shape onto a page, then groups it with other
shapes, the only delete event received is for the highest level shape
that is deleted. Thus any solution that wants to catch deletes of a
certain set of shapes must catch all deletes and check that there are
no shapes of interest in the lower groups.

Is this the case? Is there anyway of attaching what would be the
equivalent of a C++ destructor to a specific object?

Thanks,
-James
 
M

Mark Nelson [MS]

Yes, you need to handle the BeforeShapeDelete event and investigate the
sub-shapes to determine if any are of interest. Deleting a group does not
fire events for the sub-shapes. However, deleting a selection of shapes
does fire events for each shape in the selection.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

Mark Nelson [MS]

I'm not sure what you want me to look at there.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top