none
Outlook 2010 VBA, GetRootItems returns empty collection on conversation

    Question

  • I am hitting what appears to be unexpected behavior attempting to iterate through the items in a conversation. I have copied the code exactly from the code page at:

    http://code.msdn.microsoft.com/office/Outlook-2010-Manipulate-64fead5e

    The code executes correctly (no errors or interrupts).I do not get any of the message boxes that indicate something is amiss. What happens however is that the line for

    Set group = theConversation.GetRootItems 

    returns empty. My understanding of the conversation hierarchy is that every message must have a root item. Is this the expected behavior from this method? If not, is there something specific that would prevent that method from returning the correct results?

    Thanks.

    • Edited by byron wall Wednesday, December 12, 2012 4:06 PM formatting still bad
    Wednesday, December 12, 2012 3:38 PM

Answers

All replies

  • Hi Byron,

    Thank you for posting in the MSDN Forum.

    My understanding of the conversation hierarchy is that every message must have a root item.

    Yes, I've tried the code. At first, I've selected the first mail in a conversation it works fine. Then I select the other mail in the conversation, the sequence was displayed in the right order. Later I've delete the first mail in the conversation, this time the 2nd mail become the root item.

    You can refer to Conversation.GetRootItems Method for detailed information about it.

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, December 13, 2012 12:42 PM
  • Thanks for the reply.

    So if the method is not returning any elements, is there any reason for that?

    Thursday, December 13, 2012 2:08 PM
  • To follow up on this, I tried changing some settings on the Exchange account.  I changed the "Cached Exchange Mode" option and now the code above works.

    Next question: is cached mode required in order to use this method?

    I have read up a little bit on the Cached option.  The articles mention that Cached mode is required in order to use the Conversation view. I previously was having no issues with Conversation view (or the messages from other folders option).

    Thanks.

    Monday, December 17, 2012 3:51 PM
  • Hi Byron,

    As mentioned in Managing Outlook Items as Conversations.

    Conversation view is supported by stores that are POP, IMAP, PST, or Microsoft Exchange Server (at least Microsoft Exchange Server 2010, or Microsoft Exchange Server 2007 if Outlook is running in cached mode). You can call the IsConversationEnabled property of the Store object to verify whether the store supports Conversation view. 

    So I think you need running in the Cached mode  only when the Exchange Server is 2007.

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, December 18, 2012 4:51 AM