B
Balex
Hi,
I've just added a series of layers to a Visio drawing, and I've added
buttons that toggle the visibility of these layers. What I'm now trying to do
is, just before the document is closed by the user, to set all layers again
to visible. The subroutine that does that is executed properly, but the
resetting seems to be lost: on re-opening, layers that had been made
invisible by the user before closing are still hidden. What am I missing ?
Here my resetting routine, which is called by the
Document_BeforeDocumentClose(ByVal doc As IVDocument) routine:
Sub RestoreLayers(doc As Document)
Dim UndoScopeID1 As Long
UndoScopeID1 = Application.BeginUndoScope("Layer Properties")
Dim selLayer As Visio.layer
Set selLayer = doc.Pages("New overview").Layers.Item("Systems")
selLayer.CellsC(visLayerVisible).FormulaU = "1"
Set selLayer = doc.Pages("New overview").Layers.Item("Interfaces")
selLayer.CellsC(visLayerVisible).FormulaU = "1"
..... more layers reset to visible .....
Application.EndUndoScope UndoScopeID1, True
End Sub
Any help / hints would be GREATLY appreciated
Regards
Balex
I've just added a series of layers to a Visio drawing, and I've added
buttons that toggle the visibility of these layers. What I'm now trying to do
is, just before the document is closed by the user, to set all layers again
to visible. The subroutine that does that is executed properly, but the
resetting seems to be lost: on re-opening, layers that had been made
invisible by the user before closing are still hidden. What am I missing ?
Here my resetting routine, which is called by the
Document_BeforeDocumentClose(ByVal doc As IVDocument) routine:
Sub RestoreLayers(doc As Document)
Dim UndoScopeID1 As Long
UndoScopeID1 = Application.BeginUndoScope("Layer Properties")
Dim selLayer As Visio.layer
Set selLayer = doc.Pages("New overview").Layers.Item("Systems")
selLayer.CellsC(visLayerVisible).FormulaU = "1"
Set selLayer = doc.Pages("New overview").Layers.Item("Interfaces")
selLayer.CellsC(visLayerVisible).FormulaU = "1"
..... more layers reset to visible .....
Application.EndUndoScope UndoScopeID1, True
End Sub
Any help / hints would be GREATLY appreciated
Regards
Balex