Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multipage layer visibility doesn't work - Arggghh!

Status
Not open for further replies.

DROFNUD

MIS
Oct 16, 2001
40
0
0
GB
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...
 
Hi,

Did you ever get an answer to this one?
I am having exactly the same problem, although my controls are on a separate page, so I have no changes at all to the document until it is closed and re-opened...

I tried things like changing the page shown by ActiveWindow, toggling the Application.ShowChanges property and a few more. I even started to browse the shapes in the page to see if there was a Visible property I could change.

Any help is appreciated.

Ramon


I wish layers could propagate from background pages...
 

I never got to the bottom of this one, but if ever anyone finds a solution I'd be glad to hear from you.

Si...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top