S
sonyvale
I hate to ask such a trivial quesiton, but I have tried all permutations I
can think of, and searching the web, MSDN, SDKs, and even using the Event
Monitor, but I can't get an added event to call a VBA procedure. The event
object is still alive, and I have triggered it manually and traced it and
gotten the message:
-invokeAO: Failed to map 'ThisDocument.cmdShapeName' to known Add-on
IS there some trick to running a VBA procedure instead of an external addon?
The code is this:
Public evtPageTurn As Visio.Event 'this is declared earlier in the form
Private Sub UserForm_Initialize()
Dim objWindow As Visio.Window
Dim evtCode As Integer
Dim strProc As String
evtCode = visEvtCodeWinPageTurn 'the event type going to be trapped
strProc = "ThisDocument.cmdShapeName" 'the VBA procedure (it's
correct)
Set objWindow = ActiveWindow
Set evtPageTurn = objWindow.EventList.Add(evtCode, _
visActCodeRunAddon, strProc, "")
-------------------
I know the event object is set up right, it's still in scope and triggering
the event because I see it fire in the immediate trace window, but it keeps
saying that 'ThisDocument.cmdShapeName" doesn't map to known Add-On. But
that procedure does exist in ThisDocument (it's a sub not a function, doesn't
take any args, and is public).
Any thoughts?
(e-mail address removed)
can think of, and searching the web, MSDN, SDKs, and even using the Event
Monitor, but I can't get an added event to call a VBA procedure. The event
object is still alive, and I have triggered it manually and traced it and
gotten the message:
-invokeAO: Failed to map 'ThisDocument.cmdShapeName' to known Add-on
IS there some trick to running a VBA procedure instead of an external addon?
The code is this:
Public evtPageTurn As Visio.Event 'this is declared earlier in the form
Private Sub UserForm_Initialize()
Dim objWindow As Visio.Window
Dim evtCode As Integer
Dim strProc As String
evtCode = visEvtCodeWinPageTurn 'the event type going to be trapped
strProc = "ThisDocument.cmdShapeName" 'the VBA procedure (it's
correct)
Set objWindow = ActiveWindow
Set evtPageTurn = objWindow.EventList.Add(evtCode, _
visActCodeRunAddon, strProc, "")
-------------------
I know the event object is set up right, it's still in scope and triggering
the event because I see it fire in the immediate trace window, but it keeps
saying that 'ThisDocument.cmdShapeName" doesn't map to known Add-On. But
that procedure does exist in ThisDocument (it's a sub not a function, doesn't
take any args, and is public).
Any thoughts?
(e-mail address removed)