Can I show Shape Name as text in the diagram

M

Mirrorball

Hi there,

I have a selection of Visio diagrams which represent workflows within a
system. I'd like to show on the diagram a unique reference for each shape so
that I can easily reference them within a document. It strikes me that the
easiest way to do this is to use the id to acheive this.

So can anyone let me know the best way to include the Shape ID within the
shape text?

As an example, if I have a process box on a Visio diagram with text "Enter
personal details" and that box has an id of 57 then I want to automaticallty
have the text displayed as "57 - Enter personal details".

Any advice would be gratefully received!
 
J

J Kallay

I think you'll need a little bit of automation code for this. With VBA,
it's a single line of code in the ShapeAdded event handler for the Document
object:
Private Sub Document_ShapeAdded(ByVal Shape As IVShape)
Shape.Text = Shape.ID
End Sub

You could also write a macro that iterates through a page's Shapes
collection and sets the text of each shape to the ID, as above. This would
label all of your existing shapes, rather than just new ones as they are
added.
Note that this will label ALL shapes. You may want to filter out certain
types of shapes (connectors, for example).
 
P

Paul Herber

Hi there,

I have a selection of Visio diagrams which represent workflows within a
system. I'd like to show on the diagram a unique reference for each shape so
that I can easily reference them within a document. It strikes me that the
easiest way to do this is to use the id to acheive this.

So can anyone let me know the best way to include the Shape ID within the
shape text?

As an example, if I have a process box on a Visio diagram with text "Enter
personal details" and that box has an id of 57 then I want to automaticallty
have the text displayed as "57 - Enter personal details".

Any advice would be gratefully received!

menu Insert -> Field
Object Info -> ID
 

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