View Single Post
  #7  
Old August 14th 09, 12:19 PM posted to microsoft.public.outlook.program_addins
Teodora Gancheva[_2_]
external usenet poster
 
Posts: 9
Default Categories not persisted between sessions in Outlook 2007

Thanks a lot, all the information has been really helpful.

"Ken Slovak - [MVP - Outlook]" wrote:

The bug was verified by 2 other Outlook MVP's independently, so it's
definitely a bug. We all tested on Outlook 2007 SP2, so it's definitely
there.

It's been reported to MS, but I doubt anything will be fixed until SP3. It's
not a data corruption or loss problem that would require a hot fix, and the
product group is devoting most or all of their time at the moment to the
Outlook 2010 beta, so I don't see it getting high priority at this time.
BTW, the bug isn't there in the beta of Outlook 2010.

What I've done in addins where I use Categories is to have a list either in
Settings or in an XML file that I read at startup and then add my categories
to the collection as needed (if they're not there).

One of the other MVP's (who has an addin that manages categories) hacks any
custom categories into the binary property PR_ROAMING_XMLSTREAM (0x7C080102)
in the hidden item in the Calendar folder that is where the master category
list is stored. All the categories are stored there in that property in a
hidden item with the MessageClass of "IPM.Configuration.CategoryList".

Doing it that way will make the added categories permanent, since that's
where Outlook looks for the categories list. If you open that hidden item in
a MAPI viewer such as OutlookSpy (www.dimastr.com) or MFCMAPI you can look
at that binary property to see how each category entry is formatted. The
binary bits are actually XML text, so you can extract that and review how
each entry is structured. You could then get the bits as a binary array,
convert the array into a text string that's XML and use XML methods to read
and add nodes as needed. Then when finished you can simply convert the XML
text back into a binary array of bytes and write that back into the
PR_ROAMING_XMLSTREAM property on the hidden item.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Teodora Gancheva" wrote in
message ...
Hi,

In the meantime I have tested the code on 5 different machines with
Outlook
2007. It seems to be working on the RTM and SP1 versions. The issue only
exists with SP2.
Unfortunatelly, adding the categories upon start up is not applicable in
my
scenario, or at the very least is very difficult. The reason is that I am
assigning different categories to different mail items upon user action,
in
my case that is import of the email into an external system. I could
probably
save the categories to some file and then upon start up read from that
file
...
Anyways, let's see what MS have to say about this.

Thanks,
Teodora Gancheva



Ads