I have some defined shapes in a Visio 2010 stencil, and would like to set the layer depending on the value of a particular shape data field. I would like to do this within the shapesheet if at all possible, since my workplace is very limiting concerning the use of VisualBasic.
I can do the necessary look up to find a particular value, but need to translate this to the correct index in the page layers list.
Basically, I need to get the current index of a particular layer. For example, I know the name of the layer is "Remove" and need the index in ThePage!Layers so that I can set LayerMember accordingly. The index changes from page to page, so I need do this lookup in the context of the page after the shape has been dropped on the page.
How can I look up the index of an entry in ThePage!Layers, using the name of the layer as lookup index. A syntax like ThePage!Layers.Index["Remove"] doesn't work and I couldn't find any other information in the Microsoft documentation.