none
How to get email message category? RRS feed

  • Question

  • Using Exchange Server 2010, public folders.

    We have messages in our public folders with a particular category named "ABC" (example) and messages that do not have any category.  Category is the column Categories in Outlook.

    How do I read this using EWS? when I use the following code I get a count of zero even though the message is categorized as "ABC" in Outlook.  What am i missing here?

    Dim

     

     

    strList As

    StringList

     

    For Each Item As EmailMessage In itemResults.Items
      strList = Item.Categories
      Debug.WriteLine("strList count " & strList.Count)
    Next

    Any help will be greatly appreciated.
    Thank you.

     

     


    ml99
    Tuesday, August 30, 2011 3:21 PM

Answers

  • Hi,

     

    i think that itemResults is a collection returns after a search in your public folder. If so, did you set the Category property to be retreived by the search as below ?

    view.PropertySet = new PropertySet(BasePropertySet.IdOnly, ItemSchema.Categories);

     

    Regards,


    Désiré GOVIN, Refresh IT Solutions
    • Marked as answer by ml99 Tuesday, August 30, 2011 5:48 PM
    Tuesday, August 30, 2011 4:16 PM

All replies

  • Hi,

     

    i think that itemResults is a collection returns after a search in your public folder. If so, did you set the Category property to be retreived by the search as below ?

    view.PropertySet = new PropertySet(BasePropertySet.IdOnly, ItemSchema.Categories);

     

    Regards,


    Désiré GOVIN, Refresh IT Solutions
    • Marked as answer by ml99 Tuesday, August 30, 2011 5:48 PM
    Tuesday, August 30, 2011 4:16 PM
  • Hi,

    That's it, I forgot to set the Category property.  Added and now it works.

    Thanks so much!


    ml99
    Tuesday, August 30, 2011 5:49 PM