Org Chart - renaming shapes / Visio 2007/ VBA

Started by Shell_, April 24, 2011, 01:26:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Shell_

Hi All,

I'm new to Visio programming and also new in this forum, so hello everyone  ;D

I have the following task to be done and cannot handle it on my own. If you could look into this and advise some solution, it would be a great help for me.

I have an Org Chart of my department structure. What I want to do is to change shapes' name from automatic Visio label to the name of the employee displayed on the shapes. Later, I will be trying to format Shape Data on the basis of an .xls file and employee name is meant to be my unique value linking the Org Chart and Excel file.

Could you please give me some advice how to write a code to change the name of all the shapes in described way?

Many thanks in advance  ;)
And Happy Easter, of course!  :D

aledlund

You didn't mention what version/edition of visio that you're using. The good news is that if you're at v2007 Pro or above, you can use the datalinking features and autolink based on the employee name (default shapedata property of name). The vba is simple to change the name.

visShape.Name = "newname"
visShape.NameU = "newname"

a more in depth project is over here
http://visguy.com/vgforum/index.php?topic=2298.0

al