S
song
Here is the piece of code in a COM add in for Outlook. It prompts a msgbox
asking if
the user wants to exit an inspector or not. If not, cancel the operation.
Everything goes well, however outlook stays in memory every time after I
cancel the exit.
It seems there is something I did not release. But if I did not cancel the
exit operation, it is ok.
What is wrong with this? Thank you.
Private Sub objApptItem_Close(Cancel As Boolean)
On Error Resume Next
If objApptItem.Links.Count = 0 Then
If MsgBox("This appointment has no contact related, do you want to
exit?",_
vbOKCancel, _
"Appointment Exit") = vbCancel Then
Cancel = True
End If
End If
End Sub
asking if
the user wants to exit an inspector or not. If not, cancel the operation.
Everything goes well, however outlook stays in memory every time after I
cancel the exit.
It seems there is something I did not release. But if I did not cancel the
exit operation, it is ok.
What is wrong with this? Thank you.
Private Sub objApptItem_Close(Cancel As Boolean)
On Error Resume Next
If objApptItem.Links.Count = 0 Then
If MsgBox("This appointment has no contact related, do you want to
exit?",_
vbOKCancel, _
"Appointment Exit") = vbCancel Then
Cancel = True
End If
End If
End Sub