R
RichardB
Hello, First what the intention is -
I want to protect the background page from being removed from the drawing
set, or replaced in the drawing set. I want my background sheet to be
required on every New PAge, and cannot be removed from existing pages.
I know that in drawing explorer you can protect, but there is no password so
It can be unprotected by an experienced user (?).
I though VBA would be a good solution but if the user disables Macros no
dice.
*** Any suggestion on achieving this protection in Visio2003. I hope it is
easy and I have possibley overlooked the obvious.
How about VBA code on Doc open - if doc.MAcrosEnabled = FALSE then doc.close
? Does not work the code does not run if macrosEnabled = FALSE.
I have considered the following vba -
' no new bage can be added as background
Private Sub Document_PageAdded(ByVal Page As IVPage)
If Page.Background = True Then
Page.Background = False
End If
End Sub
' No delete existing background
Private Function Document_QueryCancelPageDelete(ByVal Page As IVPage) As
Boolean
If Page.Name = "Background" Then
MsgBox ("Its the background")
Document_QueryCancelPageDelete = True
Else
MsgBox ("SOme otherpage")
Document_QueryCancelPageDelete = False
End If
End Function
' Must run MAcro to open document -
' Does not work
Private Sub Document_DocumentOpened(ByVal doc As Visio.IVDocument)
If doc.MacrosEnabled = True Then
MsgBox ("Macros Enabled")
Else
MsgBox ("Please Enable Macro Execution - THis document will not open with
out them. Lower your security level")
doc.Close
End If
End Sub
I want to protect the background page from being removed from the drawing
set, or replaced in the drawing set. I want my background sheet to be
required on every New PAge, and cannot be removed from existing pages.
I know that in drawing explorer you can protect, but there is no password so
It can be unprotected by an experienced user (?).
I though VBA would be a good solution but if the user disables Macros no
dice.
*** Any suggestion on achieving this protection in Visio2003. I hope it is
easy and I have possibley overlooked the obvious.
How about VBA code on Doc open - if doc.MAcrosEnabled = FALSE then doc.close
? Does not work the code does not run if macrosEnabled = FALSE.
I have considered the following vba -
' no new bage can be added as background
Private Sub Document_PageAdded(ByVal Page As IVPage)
If Page.Background = True Then
Page.Background = False
End If
End Sub
' No delete existing background
Private Function Document_QueryCancelPageDelete(ByVal Page As IVPage) As
Boolean
If Page.Name = "Background" Then
MsgBox ("Its the background")
Document_QueryCancelPageDelete = True
Else
MsgBox ("SOme otherpage")
Document_QueryCancelPageDelete = False
End If
End Function
' Must run MAcro to open document -
' Does not work
Private Sub Document_DocumentOpened(ByVal doc As Visio.IVDocument)
If doc.MacrosEnabled = True Then
MsgBox ("Macros Enabled")
Else
MsgBox ("Please Enable Macro Execution - THis document will not open with
out them. Lower your security level")
doc.Close
End If
End Sub