M
M@
Hey,
I wish to add an Action to a Visio Master (Shape) in a stencil.
I can open the stencil, get the master, copy it, edit it, save the copy BUT
cannot save the changes to the stencil.
If I manually place the stencil in 'Edit' (Red *) then I am able to save the
changes.
My question is, how do I set the stencil to be edited, in VB. The return it
to the non-edit state after saving the changes to the master?
My code is as follows:
The error produced when executing the line 'StnObj.Save' is: Requested
Operation is Presently Disabled.
Public Sub AddRMouseMenuToMaster(strMasterShape As String, strVisioStencil
As String, strActionString As String)
Dim mastObj As Visio.Master
Dim mastObjCopy As Visio.Master
Dim StnObj As Visio.Document
Dim shpsObj As Visio.Shapes
Dim shpObj As Visio.Shape
Dim curShapeIndex As Integer
Dim cellObj As Visio.Cell
Set StnObj = Documents(strVisioStencil)
Set mastObj = StnObj.Masters(strMasterShape)
Set mastObjCopy = mastObj.Open
Set shpsObj = mastObjCopy.Shapes
Set shpObj = shpsObj(1)
Set cellObj = shpObj.Cells("Actions.Action")
' Add the action
cellObj.Formula = strActionString
mastObjCopy.Close
StnObj.Save
Set StnObj = Nothing
End Sub
Thanks
I wish to add an Action to a Visio Master (Shape) in a stencil.
I can open the stencil, get the master, copy it, edit it, save the copy BUT
cannot save the changes to the stencil.
If I manually place the stencil in 'Edit' (Red *) then I am able to save the
changes.
My question is, how do I set the stencil to be edited, in VB. The return it
to the non-edit state after saving the changes to the master?
My code is as follows:
The error produced when executing the line 'StnObj.Save' is: Requested
Operation is Presently Disabled.
Public Sub AddRMouseMenuToMaster(strMasterShape As String, strVisioStencil
As String, strActionString As String)
Dim mastObj As Visio.Master
Dim mastObjCopy As Visio.Master
Dim StnObj As Visio.Document
Dim shpsObj As Visio.Shapes
Dim shpObj As Visio.Shape
Dim curShapeIndex As Integer
Dim cellObj As Visio.Cell
Set StnObj = Documents(strVisioStencil)
Set mastObj = StnObj.Masters(strMasterShape)
Set mastObjCopy = mastObj.Open
Set shpsObj = mastObjCopy.Shapes
Set shpObj = shpsObj(1)
Set cellObj = shpObj.Cells("Actions.Action")
' Add the action
cellObj.Formula = strActionString
mastObjCopy.Close
StnObj.Save
Set StnObj = Nothing
End Sub
Thanks