Outlook Outlook Close Event Fire Multiple Times

Joined
Apr 27, 2009
Messages
6
Reaction score
0
I used Slovaks code to capture email close events to preform some checks and ask me some questions before the close completes. Sometimes when I close the email and I set the "Cancel" to True, the close event continues to fire. Sometimes it will eventually close and sometimes it keeps on cycling.

Here is the close event code:

Private Sub m_objMail_Close(Cancel As Boolean)
On Error Resume Next
If blnSkipClose <> True Then
With m_objMail
If .Subject = "" Then
If MsgBox("Subject line is blank. Coninue closing?", vbYesNo, "Blank Subject") = vbNo Then
Cancel = True
End If
End If
If .Categories = "" Then
If MsgBox("No category assigned. Assign category?", vbYesNo, "No category") = vbYes Then
.ShowCategoriesDialog
.Save
End If
End If
If .FlagStatus = olNoFlag And m_objMail.FlagIcon = olNoFlagIcon Then
If MsgBox("No reminder set. Coninue closing?", vbYesNo, "No reminder") = vbNo Then
Cancel = True
End If
End If
End With
End If
If Cancel = False Then
basOutlInsp.KillInsp m_intID, Me
Set m_objInsp = Nothing
blnSkipClose = True
End If
End Sub


Thank you for any help I can get.

-Tim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top