Reputation: 21
I'm trying to get the next layer to show when the user double clicks a shape.
I've never touched VBA within Visio so I tried the below code, I know its not much but I honestly do not have a clue unfortunately
Visio.layer.*Layername* visible = "1"
End Sub
Any help at all will be greatly appreciated.
Upvotes: 1
Views: 4472
Reputation: 394
This can actually be done via simple shapesheet functions. SetF(Getref(ThePage!=Layers.Visible[2]),true) - if you want to set Layer 2 to visible.
Switching from one layer to the next could be done be incrementing a counter on double-click + reset when max layers is reached.
=setf(getref(user.counter), if(user.counter>=user.MaxLayers, 1, user.counter+1)
Upvotes: 0
Reputation: 1734
what you mean as "Next layer" ?
In visio in Layer Properties Window layers are shown in order by name. In shapesheet layers are shown in order of creation !
VisioApp.ActivePage.Layers.Item("layername").CellsC(visLayerVisible).FormulaU = "1"
try this code
Upvotes: 2