Jack Brownridge
Jack Brownridge

Reputation: 21

Visio - Button to Show layer

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

Answers (2)

y4cine
y4cine

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

Surrogate
Surrogate

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

Related Questions