Multiple layers in multiple pages

A

appeng

I am running Visio 2000 and have several pages and each page may have several
layers. The layer name can be the same on multiple pages. The only way I know
to make the same layer name active, inactive, set print, etc. on all pages is
to go to each page and check or uncheck the associated box.

Is there a way to do this once and have all pages that include that layer
change automatically? As my understanding is that recording macros is only
available in Visio 2003 and later, I am not able to record a macro to get the
basic requirements to generate a good macro to do this. Is there any examples
of the code that I can put in VBA?
 
A

appeng

Thank You!

This is exactly what I needed to get started.
Days of looking through books and in just a few minutes you got me where I
needed to look.

Once again many Thanks.
 
J

junethesecond

But, may be better tweaked a little, that is.

Public Sub LayersContent2()
Dim PagObj As Visio.Page
Dim layersObj As Visio.Layers, layerObj As Visio.Layer
Dim shpsObj As Visio.Shapes, shpObj As Visio.Shape
Dim I As Long, N As Long

For Each PagObj In ActiveDocument.Pages
For Each shpObj In PagObj.Shapes
N = shpObj.LayerCount
If N > 0 Then
For I = 1 To N
Set layerObj = shpObj.Layer(I)
Debug.Print PagObj.Name; " "; shpObj.Name; " ";
layerObj.Name
Next
End If
Next
Next
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