Check to see if a shape exists...

J

Joe

Here's some background. I am putting together a solution that takes
information
from a database (with network component information) and automatically creates
a Visio file groups the objects by location. Here's the next part that I
want to add.

I want to put each grouping of shapes into a shape (like a rectangle). Now
I can
create the rectangle with no problem and have given them the site name. What
happens is that I end up with a rectangle for each component. So I want to
see
if a rectangle for that site has already been created. Oh, I am using VBA
currently
but will port it to .NET after it is all working.

Does anyone know how to do this? Any help would be appreciated.
 
J

Joe

I figured it out. It may not be the most elegant way to do it (I look at all
the
shapes on the page and look to match the name). It's a little slow, but it
works like a champ.
 
D

David P (Visio MVP)

A quick way is to try naming a shape the same as the one you are looking for.
If it is successful (thus no numbers are added to the name) then the shape
with that name does not exist....
 

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