none
sub folders not populating RRS feed

  • Question

  • I'm creating an C# VSTO outlook add-in. One specific method moves an email from a shared mailbox in to one of the sub folders of this shared mailbox.

    However, the sub folders from the shared mailbox are only getting populated when the shared mailbox is accessed first. I can't access the sub folders when the user hasn't clicked on the shared inbox in outlook.

    I assume outlook only loads the sub folders when accessing the shared mailbox. So when outlook is started for the first time, the user must first click the inbox link on the shared mailbox.

    Is there any way to resolve this? Perhaps programmatic focusing the outlook explorer on the shared mailbox?

     

    EDIT:

    I've found a way in order to focus the outlook explorer on the shared mailbox:

                   MAPIFolder SupportFolder = ns.GetSharedDefaultFolder(recipient, Outlook.OlDefaultFolders.olFolderInbox);
                app
    .ActiveExplorer().CurrentFolder = SupportFolder;

    It does select the shared mailbox but doesn't populate the subfolders in code... This still only happens when manually clicking.

    Does anyone have a solution for this strange behavior?

    Friday, August 5, 2011 11:05 AM

Answers

  • Have you tried "touching" an item in one or all of the subfolders? That is, getting the folder and its Items collection and then opening an item from the Items collection?
     
    For performance reasons Outlook may not download items from a secondary store until the store is accessed.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "rohan_g" <=?utf-8?B?cm9oYW5fZw==?=> wrote in message news:5a9b860b-71b1-40f2-ae5d-58f73480f07b...

    I'm creating an C# VSTO outlook add-in. One specific method moves an email from a shared mailbox in to one of the sub folders of this shared mailbox.

    However, the sub folders from the shared mailbox are only getting populated when the shared mailbox is accessed first. I can't access the sub folders when the user hasn't clicked on the shared inbox in outlook.

    I assume outlook only loads the sub folders when accessing the shared mailbox. So when outlook is started for the first time, the user must first click the inbox link on the shared mailbox.

    Is there any way to resolve this? Perhaps programmatic focusing the outlook explorer on the shared mailbox?

     

    EDIT:

    I've found a way in order to focus the outlook explorer on the shared mailbox:

                   MAPIFolder SupportFolder = ns.GetSharedDefaultFolder(recipient, Outlook.OlDefaultFolders.olFolderInbox);
                app
    .ActiveExplorer().CurrentFolder = SupportFolder;

    It does select the shared mailbox but doesn't populate the subfolders in code... This still only happens when manually clicking.

    Does anyone have a solution for this strange behavior?


    Ken Slovak MVP - Outlook
    Friday, August 5, 2011 12:53 PM
    Moderator