0

I'm trying to set the text field of a shape to the name of the layer it is on (Visio 2010). I should be able to set the formula to this:

=ThePage!Layers.Name[LayerMember]

but that doesn't work because LayerMember is a string and a shape can be on multiple layers, i.e., LayerMember = "3" if it is only on the 3rd layer but can be "3;2;5" if it is on three different layers. So, using LEFT(LayerMember, 1) gets the first value in the list but putting that in the index field of the above formula doesn't work either. Putting a static value in the index field works just fine but I want to be able to change the layer of a shape and have the text on the shape change to the layer name.

Using LEFT(LayerMember,1) returns a string. I can't find a way to convert the string value to a number to get the layer name value from the page's shapesheet.

I'm new at Visio but for some reason I can't figure this one out.

4

1 回答 1

1

图层是形状的属性,因此请尝试 shpObj.Layer(1).Name 这将为您提供形状所在的第一层的名称。您需要检查 shjObj.LayerCount 以确保该形状实际上位于图层上。

于 2013-07-13T14:34:56.573 回答