I
Irshad Ahmed
Hi
I am struggling with solving the AddAdvise method and
getting it to work for me to detect when a shape is added
to a page in Visio.
I need for the application to be a seprate program not VB
in Visio. Hance need to use the AddAdvise.
I need to detect this any time a shape is added.
I have ready referanced
Developing Microsoft Visio Solutions
Professional Delvelopment with Visio 2002
Visio 2002 Delveloper's Survival Pack
I think I am close but am still not getting the code to
work correctly.
The project is an Active X exe
The form (frmVisioMenu) which runs includes
Set g_Sink = New EventSink
Set eventsObj = visDoc.EventList
eventsObj.AddAdvise (visEvtShape + visEvtAdd),
g_Sink, "", "Shape Added.."
Their is a class module also which includes
Public Sub VisEventProc(eventCode As Integer, sourceObj As
Object, eventID As Long, _
seqNum As Long, subjectObj As
Object, moreInfo As Variant)
Dim strDumpMsg As String
Select Case eventCode
Case (visEvtAdd + visEvtShape)
strDumpMsg = "Shape Add(" & eventCode & ")"
Case Else
strDumpMsg = "Other(" & eventCode & ")"
End Select
frmVisioMenu.TextBox1.Text = strDumpMsg
------------------------------------------------
The program start off without problem, it creates an
instance of Visio and also loads a stecil (code not
shown), but when I add shapes I do not see those shapes
reported at all?
Will be very Thankful for insight.
I am struggling with solving the AddAdvise method and
getting it to work for me to detect when a shape is added
to a page in Visio.
I need for the application to be a seprate program not VB
in Visio. Hance need to use the AddAdvise.
I need to detect this any time a shape is added.
I have ready referanced
Developing Microsoft Visio Solutions
Professional Delvelopment with Visio 2002
Visio 2002 Delveloper's Survival Pack
I think I am close but am still not getting the code to
work correctly.
The project is an Active X exe
The form (frmVisioMenu) which runs includes
Set g_Sink = New EventSink
Set eventsObj = visDoc.EventList
eventsObj.AddAdvise (visEvtShape + visEvtAdd),
g_Sink, "", "Shape Added.."
Their is a class module also which includes
Public Sub VisEventProc(eventCode As Integer, sourceObj As
Object, eventID As Long, _
seqNum As Long, subjectObj As
Object, moreInfo As Variant)
Dim strDumpMsg As String
Select Case eventCode
Case (visEvtAdd + visEvtShape)
strDumpMsg = "Shape Add(" & eventCode & ")"
Case Else
strDumpMsg = "Other(" & eventCode & ")"
End Select
frmVisioMenu.TextBox1.Text = strDumpMsg
------------------------------------------------
The program start off without problem, it creates an
instance of Visio and also loads a stecil (code not
shown), but when I add shapes I do not see those shapes
reported at all?
Will be very Thankful for insight.