I have the following macro in Visio 2002. I have placed an object on each page so that when I double click it, the detail in the document are hidden or shown, allowing a technical, and non-technical viewpoints.
The problem is: When you hide all the page layers, the objects on the active page are hidden, and the layers on the other page are hidden too, but when you select another page they are still visible... Any idea's?
Sub ShowDetails()
Dim Layer As Visio.Layer
Dim Page As Visio.Page
Dim nState As Byte: nState = 255 '# Multipage layer
For Each Page In ActiveDocument.Pages
For Each Layer In Page.Layers 'ActivePage.Layers
If Layer.Name = "Detail" Then
'# Set up document visibility status
If nState = 255 Then
If Layer.CellsC(visLayerVisible) = 0 Then
nState = 1
Else
nState = 0
End If
End If
'# Set page layer
Layer.CellsC(visLayerVisible) = nState
Layer.CellsC(visLayerPrint) = nState
End If
Next
Next
End Sub
Thanks in advance...
Si...
The problem is: When you hide all the page layers, the objects on the active page are hidden, and the layers on the other page are hidden too, but when you select another page they are still visible... Any idea's?
Sub ShowDetails()
Dim Layer As Visio.Layer
Dim Page As Visio.Page
Dim nState As Byte: nState = 255 '# Multipage layer
For Each Page In ActiveDocument.Pages
For Each Layer In Page.Layers 'ActivePage.Layers
If Layer.Name = "Detail" Then
'# Set up document visibility status
If nState = 255 Then
If Layer.CellsC(visLayerVisible) = 0 Then
nState = 1
Else
nState = 0
End If
End If
'# Set page layer
Layer.CellsC(visLayerVisible) = nState
Layer.CellsC(visLayerPrint) = nState
End If
Next
Next
End Sub
Thanks in advance...
Si...