deleting shape

S

salla

Hi

I link two shapes in Visio. When I delete the first, i want to delete
the second. I override the event beforehapedelte. I put all the code
to suppress the second shape. When I run my sample, visio doesn't run
correctly and crashes. I want to known if somebody has an idea or
solution to solve this problem.
 
R

Reinier Post

salla said:
Hi

I link two shapes in Visio. When I delete the first, i want to delete
the second. I override the event beforehapedelte. I put all the code
to suppress the second shape. When I run my sample, visio doesn't run
correctly and crashes. I want to known if somebody has an idea or
solution to solve this problem.

You can write a BeforeShapeDelete handler for a shape aShape,
determine a second shape anotherShape, and call anotherShape.Delete.
This is expected to work. But you have to be careful not to keep
Visio.Shape objects around and use their properties or methods after
the shape has already been deleted. That, in my experience, tends to
lead to "Invalid shape identifier" exceptions. Perhaps this can explain
your problem.
 

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