- Joined
- Nov 3, 2015
- Messages
- 2
- Reaction score
- 0
I am writing a program in VB to detect when an appointment is deleted from a shared exchange calendar, and then send an email notification that that item was deleted. We use Office 365 and Exchange server 2010. When I delete the appointment it shows up in "Recover deleted Items" (BeforeItemDelete does not work).
So I setup the Redemption library but I can't figure out how to retrieve the subject of the deleted appointment. After some reading and research I understand that I can use RDOs ItemRemove if I cache the Entry_ID using MAPITable and then use PR_Instance_Key to somehow get the subject. But I have no idea how to actually do this practically speaking - I'm hoping someone out there point me in the direction of the right literature to understand how to use MAPITable in this way?
Here's what I have so far:
'Trigger on events
Dim WithEvents trashCalendar As Redemption.RDOItems
'Sets up the Calendar folders and item variables
Private Sub Application_Startup()
'Outlook Redemption variables Set Session2 = CreateObject("Redemption.RDOSession")
Session2.Logon
Set RDOJobFolder = Session2.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("TRSI - Canada")
Set RDOJobFolder = RDOJobFolder.Folders("Marine Jobs")
Set trashCalendar = RDOJobFolder.DeletedItems
End Sub
'Detect "Delete" event
Private Sub trashCalendar_ItemAdd(ByVal Item As RDOMail)
Dim olkMsg As Outlook.MailItem
Set olkMsg = Application.CreateItem(olMailItem)
With olkMsg
'Add more recipients as needed by duplicating the next line'
.Recipients.Add "test.email"
.Recipients.ResolveAll
'Change the subject ont he next line'
.Subject = "000-Marine Job Deleted from Calendar"
'Change the message body on the next line'
.Body = "****DELETE**** " & Item.Subject
.Send
End With
Set olkMsg = Nothing
End Sub
So I setup the Redemption library but I can't figure out how to retrieve the subject of the deleted appointment. After some reading and research I understand that I can use RDOs ItemRemove if I cache the Entry_ID using MAPITable and then use PR_Instance_Key to somehow get the subject. But I have no idea how to actually do this practically speaking - I'm hoping someone out there point me in the direction of the right literature to understand how to use MAPITable in this way?
Here's what I have so far:
'Trigger on events
Dim WithEvents trashCalendar As Redemption.RDOItems
'Sets up the Calendar folders and item variables
Private Sub Application_Startup()
'Outlook Redemption variables Set Session2 = CreateObject("Redemption.RDOSession")
Session2.Logon
Set RDOJobFolder = Session2.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("TRSI - Canada")
Set RDOJobFolder = RDOJobFolder.Folders("Marine Jobs")
Set trashCalendar = RDOJobFolder.DeletedItems
End Sub
'Detect "Delete" event
Private Sub trashCalendar_ItemAdd(ByVal Item As RDOMail)
Dim olkMsg As Outlook.MailItem
Set olkMsg = Application.CreateItem(olMailItem)
With olkMsg
'Add more recipients as needed by duplicating the next line'
.Recipients.Add "test.email"
.Recipients.ResolveAll
'Change the subject ont he next line'
.Subject = "000-Marine Job Deleted from Calendar"
'Change the message body on the next line'
.Body = "****DELETE**** " & Item.Subject
.Send
End With
Set olkMsg = Nothing
End Sub
Last edited by a moderator: