0
votes

So here is the setup: I'm using Visio creating a diagram using different shapes from stencils. Later I will have excel files with data connected to the different kind of shapes. The excel files will be updated fairly regularly. Since the diagram is going to be quite complex, so Shapes are going to have hyperlinks linking to shapes in the current document. For the hyperlinks I like to name the shapes according to their meaning. This will be done by hand and once.

So what I'm trying to accomplish now is to programmatically change the shape data matching the shape name. Since the different kind of shapes have different data sets assigned I need a way to filter the shapes in the document by their kind/appearance. For example: Triangles have a date assigned as shape data and Rectangles a zip code. Having two triangles named Bert and Ernie and three rectangles named Huey, Dewey, and Louie the respective shape data shall by assigned.

How can I determine which in the collection of shapes in a sheet-Object is a triangle and which a rectangle?

Btw: the Master-Property has a Name and NameU (and more fields), but those are changed when you give the shape a name. This is what I tried so far. No Luck.

Any suggestion would be greatly appreciated.

Dacrow28

2
Btw: the Master-Property has a Name and NameU (and more fields), but those are changed when you give the shape a name. I can understand when you change shape (entity) name. But why you need master-shape name ? In this case I have one idea - you can add user-defined cell where you can store native master-shape name !Surrogate
PS if you change master-shape name, shp.Master.NameU property contain native master-shape name !Surrogate
Thx Surrogate. Thats the one. I completely overlooked Master and totally concentrated erroneously on MasterShape. shp.Master.NameU and shp.Master.Name don't change when giving the entity/shape a shape name.dacrow28

2 Answers

2
votes

Since I can't mark the comment of surrogate as answer I'm gonna quote him.

PS if you change master-shape name, shp.Master.NameU property contain native master-shape name !

Thx Surrogate. Thats the one. I completely overlooked Master and totally concentrated erroneously on MasterShape. shp.Master.NameU and shp.Master.Name don't change when giving the entity/shape a shape name.

0
votes

You can use a Selection object to get all the shapes of a particular master, and it should execute faster than a search of every shape.

Use the Page.CreateSelection method, and you s