none
Outlook - How to empty "Deleted Items" for shared folders RRS feed

  • Question

  • Attempting to create an outlook add-in that connects to various shared inbox's, processes, then deletes the incoming mail items. Due to size limitations on the accounts it's preferable for the add-in to manage the 'Deleted Items' folders in the shared accounts also.

    GetSharedDefaultFolder(recipient, Outlook.OlDefaultFolders.olFolderInbox) works for accessing, processing and initially deleting items, but cannot be used to get a reference to 'olFolderDeletedItems' for final deletion (remarks section, end of second paragraph).

    Is there any alternative method available to accomplish this task?

    Thursday, June 14, 2012 7:47 PM

Answers

  • you could either get parent of shared inbox folder and then iterate its Folders to match folder by name (Deleted Items) or you could store of that shared inbox and read entryid of PR_IPM_WASTEBASKET_ENTRYID (http://schemas.microsoft.com/mapi/proptag/0x35E30102) and get filder by its entry id or you could use redemption and use option to delete items without moving them to deleted items folder.
    • Marked as answer by NathanCockram Friday, June 15, 2012 6:24 PM
    Friday, June 15, 2012 7:18 AM

All replies

  • you could either get parent of shared inbox folder and then iterate its Folders to match folder by name (Deleted Items) or you could store of that shared inbox and read entryid of PR_IPM_WASTEBASKET_ENTRYID (http://schemas.microsoft.com/mapi/proptag/0x35E30102) and get filder by its entry id or you could use redemption and use option to delete items without moving them to deleted items folder.
    • Marked as answer by NathanCockram Friday, June 15, 2012 6:24 PM
    Friday, June 15, 2012 7:18 AM
  • Redemption also has no limitation on what kind of folder you can retrieve using RDOSession.GetSharedDefaultFolder or RDOStore.GetDefaultFolder given you have the appropriate permissions to do that.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Friday, June 15, 2012 5:42 PM
  • Did not think to look for a .Parent property off of the inbox, then iterate back down by name. That worked perfectly. Thank you very much for the help.


    Friday, June 15, 2012 6:23 PM
  • Appreciate your work on Redemption; I may move to using it if it can get approval.
    Friday, June 15, 2012 6:27 PM
  • A word of caution: I have seen cases when Folder.Parent returns a local folder if Outlook is caching shared folders in the primary store's OST file.

    Don't know if that happens for the Inbox folder, but it does happen for the Calendar and Contacts default folders.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Friday, June 15, 2012 7:22 PM