ItemAdd Event does not fire consistently

I

Istabrak

Greetings,

I am using VBA to code my ItemAdd event handler to capture any new
items in the "Sent Items" folder.

I am using Outlook2k and WinXP Pro.
Sometimes it fires correctly while at othertimes the handler does not
get called at all.
I noticed that if I restart/shutdown the pc it works for a while.
Here is a sample of my code.
Is this a known problem?

Thanks in advance,

Ista

-----------------
' All the code is in the "ThisOutlookSession"

Private WithEvents sentMailItems As Outlook.Items
Private sentItemRecipientColl As New Collection

Private Sub sentMailItems_ItemAdd(ByVal Item As Object)

MsgBox "A new mail has been added to the Sent Mail folder", ,
Item.Subject

'Debug.Print "Item.To: " & Item.To
For intj = 1 To sentItemRecipientColl.Count
If StrComp(Item.To, sentItemRecipientColl(intj), 1) = 0
Then
'Debug.Print "Handler: Item Exists"
Item.Delete
Exit For
End If
Next

End Sub
 

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