1
votes

Consider the following scenario: Sombody shared a calendar with me. I have full access to this calendar. When i delete an Item in the calendar the Folder.BeforeItemMove Event is fired. So far so good. I want to Track deletion by check wether the MoveTo Entry id is null or the Entry id of the Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderDeletedItems) which works. Now back to the case where the item is in a shared folder:

  • As per documentation the Property olFolderDeletedItems is a no go as parameter for GetSharedDefaultFolders() (Just to be sure i accessed the other folders which were allowed which worked)
  • I tried to Iterate over the Stores collection. No calendar there
  • I tried to Access the Store Property on the MoveTo folder -> null
  • I tried to get the Store from the Session (to inspect the PR_IPM_WASTEBASKET_ENTRYID) -> Fails
  • I CAN get the folder name Problem with this is , it might be renamed and/or localized and i do not want an array with all the deleted folder names floating around if i can't help it
  • I tested all of this using either plain OOM or redemptions Folder interface

Any Ideas?

(Tested in Outlook 2016)

2
I'm confused: are you trying to access the Deleted Items folder in a Shared Mailbox? Or trap when an item is deleted from a Shared Calendar? - Eric Legault
The deleteion of an Item in a Shared Calendar (not a calendar from a shared Mailbox, these I can access with the stores method as i described).I am using the pattern described in the MSDN to wrap inspectors (No problems there I get the before delete event) But when a user deletes an appointment the only event you get are the folder events. If you wrap the items in the folder events, you get in 7 kinds of RCW hells. - knechtrootrecht
Are you saying the AppointmentItem.BeforeDelete event is NOT firing for items in the shared calendar even though you have it trapped in an Inspector wrapper? - Eric Legault
This would theoretically fire if it were wrapped, BUT, there is never a Inspector_New event for D'n'D or Items deleted via the context menu - Wrapping them on selection changes leads to all kind of funny business when there is also an inspector open event. - knechtrootrecht
What's a "D'nD'? BTW, you can trap the Ribbon control for context menus if you're working with selections. But I hear you - trapping a delete for an item in all possible scenarios is a LOT of work. This is where Redemption can be handy, as you can trap a single delete event for an entire Store. - Eric Legault

2 Answers

0
votes

RDOStore.GetDefaultFolder(olFolderDeletedItems) and RDOSession.GetSharedDefaultFolder(olFolderDeletedItems) both work in Redemption.

0
votes

If you have access to the Calendar as a Shared Calendar (e.g. Sent as EMail invitation to you via the OWA) deleted Items go to YOUR deleted items Folder. This you can get via Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderDeletedItems)

If the Calendar is in a second mailbox in your profile the deleted item go to the deleted items folder of THAT account which you can acces via

Outlook.Store _Store = MoveTo.Store;

Outlook.Folder _Folder = MoveTo.GetDefaultFolder (OlDefaultFolders.olFolderDeletedItems) as Outlook.Folder;

You can differntiate these two scenarios by Checking if the Folder.Store is null (which it is in the case of an Shared non mailbox calendar)