MS Outlook 2013 deletes custom categories added into MasterCategoryList via Exchange Web Services API

Hello Exchange developers,

I successfully added several custom categories into MasterCategoryList via Exchange Web Services API. I used a sample:

var list = MasterCategoryList.Bind(service);
list.Categories.Add(
   new Category {
            Name = "Vacation",
            Color = CategoryColor.DarkMaroon,
            KeyboardShortcut = CategoryKeyboardShortcut.CtrlF10,
            Id = Guid.NewGuid()

});

But after some time I noticed my custom categories went away for some reason. It happened after I created a category manually inside MS Outlook 2013. I found out despite I assigned "Guid.NewGuid()" to the "Id" property after some time MS Exchange nullify it ("0000-0000-..."). Does anybody solve such a problem? Thanks for your attention.

July 2nd, 2013 10:34am

When you added the categories did you create the Master List from Scratch or modify the existing list ?. The only reason that Outlook would nullify the GUID is if the XML you writing back into the property isn't valid. You might want to check this with a MAPI editor it sounds like its getting corrupted and Outlook is just fixing it for you. You may need to compare the format with an unmodified default category list.

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
July 3rd, 2013 4:02am

Hello Glen. Thanks for your answer.

It seems I resolved this problem. It appeared contents of the "Id" property (Category class) should be wrapped inside curly brackets. In my case I used "Guid" type for "Id" property. Serializer applied "ToString" method and "Id" property looked like "e6de9b1b-a81c-46f6-81b3-c23edfab4478" but valid value is "{e6de9b1b-a81c-46f6-81b3-c23edfab4478}". So I changed type of "Id" property to "string". And valid version looks like:

var list = MasterCategoryList.Bind(service);

list.Categories.Add(

new Category { Name = "Vacation", Color = CategoryColor.DarkMaroon, KeyboardShortcut = CategoryKeyboardShortcut.CtrlF10, Id = "{" + Guid.NewGuid() + "}";

});

Please be aware.

July 3rd, 2013 7:04am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics