inovermyhead
Member
- Outlook version
- Outlook 2010 32 bit
- Email Account
- Exchange Server
Hello
I have the following code in ThisOutlookSession but it is not doing anything when I delete an item from my Inbox. Have I missed something?
Thanks in advance
John
I have the following code in ThisOutlookSession but it is not doing anything when I delete an item from my Inbox. Have I missed something?
Code:
Option Explicit
Private WithEvents deletedItems As Outlook.Items
Public Sub Application_Startup()
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Set olApp = Outlook.Application
Set objNS = olApp.GetNamespace("MAPI")
Set deletedItems = objNS.GetDefaultFolder(olFolderDeletedItems).Items
End Sub
Private Sub deletedItems_ItemAdd(ByVal item As Object)
Debug.Print deletedItems.Items(i).EntryID
End Sub
Thanks in advance
John