none
How to check if item is deleted if I have multiple pst files in my Outlook? RRS feed

  • Question

  • In VB.NET

    I use the oAppNS.GetItemFromID(entryid) to search for the item and if the item's parent folder is "Deleted Items" folder, I would consider it as a deleted item. 

    I use this code to find the "Deleted Items"
    Dim dItems As Outlook.Folder = oAppNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderDeletedItems)

    It works when the items are in the primary store.

    I have multiple pst files in Outlook. If I delete an item which is not in the primary store (on different pst). The item will go to the "Deleted Items" in that pst file

    How can I get the "Deleted items" folder in the pst file?

    Or,

    Is there a more easy way? For example, if the parent folder is "Deleted Items" folder type????

    Thanks and Regards,

    Cowcow

    Friday, August 1, 2014 12:41 PM

Answers

  • Hello,

    You can use the GetDefaultFolder method of the Store class instead. Thus, you will be able to get a store-specific Deleted Items folder. Here is what MSDN states:

    This method is similar to the GetDefaultFolder method of the  NameSpace  object. The difference is that this method gets the default folder on the delivery store that is associated with the account, whereas  NameSpace.GetDefaultFolder returns the default folder on the default store for the current profile.

    FYI The Namespace class provides the Stores property which returns a Stores collection object that represents all the Store objects in the current profile.
    Friday, August 1, 2014 1:16 PM

All replies

  • Hello,

    You can use the GetDefaultFolder method of the Store class instead. Thus, you will be able to get a store-specific Deleted Items folder. Here is what MSDN states:

    This method is similar to the GetDefaultFolder method of the  NameSpace  object. The difference is that this method gets the default folder on the delivery store that is associated with the account, whereas  NameSpace.GetDefaultFolder returns the default folder on the default store for the current profile.

    FYI The Namespace class provides the Stores property which returns a Stores collection object that represents all the Store objects in the current profile.
    Friday, August 1, 2014 1:16 PM
  • It works.

    Thank you.

    Friday, August 1, 2014 1:52 PM