W
WizZerD
Hi, I have added an event for visEvtCodeShapeParentChange this works fine for shapes that are already on the page
When I drop a new shape, the event doesn't fire .. Anyone know why
Implements Visio.IVisEventPro
'Declare visEvtAdd as a 2-byte valu
'to avoid a run-time overflow erro
Private Const visEvtAdd% = &H800
Private Function IVisEventProc_VisEventProc(
ByVal nEventCode As Integer,
ByVal pSourceObj As Object,
ByVal nEventID As Long,
ByVal nEventSeqNum As Long,
ByVal pSubjectObj As Object,
ByVal vMoreInfo As Variant) As Varian
Dim strMessage As Strin
'Find out which event fire
Select Case nEventCod
Case visEvtCodeShapeDelet
strMessage = "ShapesDeleted(" & nEventCode & ")
Case visEvtCodeShapeParentChang
strMessage = "ShapeParentChanged " & vbCrLf &
"Object:" & pSubjectObj.Name & vbCrLf &
"New Parent:" & pSubjectObj.Paren
If Left(pSubjectObj.Parent, 15) = "WLI Application" The
addFunctionToApp pSubjectObj, CStr(pSubjectObj.Parent
Els
MsgBox (pSubjectObj.Parent
End I
Case Els
strMessage = "Other (" & nEventCode & ")
End Selec
'Display the event name and the event cod
'MsgBox (strMessage
End Functio
Private Sub addFunctionToApp(iFunction As Object, iApp As String
MsgBox ("New Parent for " & iFunction.Name & " = " & iApp
End Sub
When I drop a new shape, the event doesn't fire .. Anyone know why
Implements Visio.IVisEventPro
'Declare visEvtAdd as a 2-byte valu
'to avoid a run-time overflow erro
Private Const visEvtAdd% = &H800
Private Function IVisEventProc_VisEventProc(
ByVal nEventCode As Integer,
ByVal pSourceObj As Object,
ByVal nEventID As Long,
ByVal nEventSeqNum As Long,
ByVal pSubjectObj As Object,
ByVal vMoreInfo As Variant) As Varian
Dim strMessage As Strin
'Find out which event fire
Select Case nEventCod
Case visEvtCodeShapeDelet
strMessage = "ShapesDeleted(" & nEventCode & ")
Case visEvtCodeShapeParentChang
strMessage = "ShapeParentChanged " & vbCrLf &
"Object:" & pSubjectObj.Name & vbCrLf &
"New Parent:" & pSubjectObj.Paren
If Left(pSubjectObj.Parent, 15) = "WLI Application" The
addFunctionToApp pSubjectObj, CStr(pSubjectObj.Parent
Els
MsgBox (pSubjectObj.Parent
End I
Case Els
strMessage = "Other (" & nEventCode & ")
End Selec
'Display the event name and the event cod
'MsgBox (strMessage
End Functio
Private Sub addFunctionToApp(iFunction As Object, iApp As String
MsgBox ("New Parent for " & iFunction.Name & " = " & iApp
End Sub