How do I use a macro to make visio layers visible?

J

JimLudden

I have several drawings each with seven layers. I wish to automate making
each layer visible (one at a time).
How do I specify the layer property (say it is layer "OASN") so that I can
write a statement XXXX.visible = TRUE?
 
A

Al Edlund

I just used the record macro function on v2003 to do this one for a single
layer

Sub Macro1()
' Keyboard Shortcut: Ctrl+i
'
Dim UndoScopeID1 As Long
UndoScopeID1 = Application.BeginUndoScope("Layer Properties")
Dim vsoLayer1 As Visio.Layer
Set vsoLayer1 = Application.ActiveWindow.Page.Layers.Item("OASN")
vsoLayer1.CellsC(visLayerVisible).FormulaU = "1"
Application.EndUndoScope UndoScopeID1, True

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top