none
Mail App for Outlook: Get Catagories RRS feed

  • Question

  • Hello

    Is it possible to read users catagories (get their color and name) in mail apps for outlook and how would this be achived?

    I have looked into EWS and FindItem method...could i use this method to retrive available catagories? How would a QueryString parameter look like, if so? Or is there another way to get this done?

    Thank you


    Anze Javornik

    Tuesday, January 8, 2013 2:26 PM

Answers

  • Anze,

    You can use FindItem to get the category list item. Your query will look like this:

        var result = 
     '    <FindItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" Traversal="Associated">' + 
     '      <ItemShape>' + 
     '        <t:BaseShape>IdOnly</t:BaseShape>' +
     '      </ItemShape>' + 
     '      <Restriction>' + 
     '        <t:IsEqualTo>' + 
     '          <t:FieldURI FieldURI = "item:ItemClass" />' +
     '          <t:FieldURIOrConstant>' +
     '            <t:Constant Value="IPM.Configuration.CategoryList" />' +
     '          </t:FieldURIOrConstant>' +
     '        </t:IsEqualTo>' + 
     '      </Restriction>' + 
     '      <ParentFolderIds>' +
     '        <t:DistinguishedFolderId Id="calendar"/>' +
     '      </ParentFolderIds>' +
     '    </FindItem>'; 

    Once you've got the item, you need to retrieve the PidTagRoamingXmlStream property, like so:

    <t:AdditionalProperties>
      <t:ExtendedFieldURI PropertyTag="31752" PropertyType="Binary" />
    </t:AdditionalProperties>
    That'll get you the master list of categories. For an individual item, you just want item:ItemClass.
    • Marked as answer by Anze Javornik Saturday, January 19, 2013 11:12 AM
    Friday, January 18, 2013 6:23 PM

All replies

  • Hi Anze,

    Thanks for posting in the MSDN Forum.

    I will involve some experts into your thread to see whether they can help you. There might be some time delay, appreciate for your patience.

    Have a good day,

    Tom


    Tom Xu [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.

    Wednesday, January 9, 2013 5:12 AM
    Moderator
  • Anze,

    You can use FindItem to get the category list item. Your query will look like this:

        var result = 
     '    <FindItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" Traversal="Associated">' + 
     '      <ItemShape>' + 
     '        <t:BaseShape>IdOnly</t:BaseShape>' +
     '      </ItemShape>' + 
     '      <Restriction>' + 
     '        <t:IsEqualTo>' + 
     '          <t:FieldURI FieldURI = "item:ItemClass" />' +
     '          <t:FieldURIOrConstant>' +
     '            <t:Constant Value="IPM.Configuration.CategoryList" />' +
     '          </t:FieldURIOrConstant>' +
     '        </t:IsEqualTo>' + 
     '      </Restriction>' + 
     '      <ParentFolderIds>' +
     '        <t:DistinguishedFolderId Id="calendar"/>' +
     '      </ParentFolderIds>' +
     '    </FindItem>'; 

    Once you've got the item, you need to retrieve the PidTagRoamingXmlStream property, like so:

    <t:AdditionalProperties>
      <t:ExtendedFieldURI PropertyTag="31752" PropertyType="Binary" />
    </t:AdditionalProperties>
    That'll get you the master list of categories. For an individual item, you just want item:ItemClass.
    • Marked as answer by Anze Javornik Saturday, January 19, 2013 11:12 AM
    Friday, January 18, 2013 6:23 PM
  • Thank you for this anwser.

    I will test it later today and confirm your anwser.


    Anze Javornik

    Friday, January 18, 2013 6:32 PM
  • This worked. It returned base64 string representation and after converting it i got just first n of data

    For others who might need this aswell: after you get the item with FindItem method, you need to call GetItem method for that property, since FindItem result is cropped.

    Additional information for others: i didnt really search for it on internet but color index of catagories is index of a row in the following table. (one field is background color, one is font color, rest i didnt even bother figuring out)

    [["#000000","#840217","#FF1A36","#EE5669"],
    ["#000000","#C45502","#FF8C00","#FEAD61"],
    ["#000000","#AF7000","#F4B10B","#F7C768"],
    ["#000000","#B59B02","#FFF100","#FFF36D"],
    ["#000000","#135B01","#009E48","#5CBB81"],
    ["#000000","#00725C","#00B294","#5DC9B4"],
    ["#000000","#5B6020","#89933F","#ADB37C"],
    ["#000000","#036393","#00BCF2","#57D2F5"],
    ["#000000","#552EBF","#8E69DF","#AF9AE7"],
    ["#000000","#960269","#F30092","#F057AE"],
    ["#000000","#425066","#6C7E9A","#9AA8BB"],
    ["#FFFFFF","#13243D","#425066","#7B8694"],
    ["#000000","#555555","#969696","#B3B3B4"],
    ["#FFFFFF","#222222","#525552","#868886"],
    ["#FFFFFF","#000000","#282828","#545454"],
    ["#FFFFFF","#510116","#A00023","#BC4D67"],
    ["#FFFFFF","#5E260A","#C45502","#D5885A"],
    ["#FFFFFF","#422602","#AF7000","#C69A5A"],
    ["#FFFFFF","#604E01","#B59B02","#CBB860"],
    ["#FFFFFF","#082801","#176002","#608F55"],
    ["#FFFFFF","#013522","#00725C","#549D8D"],
    ["#FFFFFF","#383800","#5C6022","#8D8F68"],
    ["#FFFFFF","#09243A","#036393","#5094B3"],
    ["#FFFFFF","#090155","#422F8E","#7A71AF"],
    ["#FFFFFF","#420034","#960269","#B55596"]];

     

    Anze Javornik

    Saturday, January 19, 2013 11:24 AM
  • Hello,

    the suggested FindItem search for ItemClass IPM.Configuration.CategoryList has recently stopped working on our local Exchange mailbox.

    The EWS request returns:
    status="succeeded"
    value=""

    When using an Office 365 mailbox, this still works fine, though.

    Is there any reason that FindItem would behave differently on Office 365 and the Exchange server? Please advise.

    Thanks,
    Matjaž



    • Edited by karstdev Tuesday, March 17, 2015 12:22 PM
    Tuesday, March 17, 2015 11:26 AM
  • Following up on my previous post:

    It seems the issue in Outlook (i.e. on our Exchange server) has resolved itself. I suspect it was caused and resolved by some periodic Microsoft update.

    Best regards,
    Matjaž

    Tuesday, May 19, 2015 12:12 PM