Is your default mail account by chance IMAP? That could explain it as IMAP
doesn't support categories. Outlook won't try to write the categories to the
Master Category List until you close it, and that's when they get lost.
Other ideas: you're connected to a mailserver other than Exchange, or you
don't have the permission to write to the default calendar of the mailbox.
Did you test already whether or not you can add categories to the mailbox by
using Outlook's Categorize dialog?
--
Best regards
Michael Bauer - MVP Outlook
: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en
Am Wed, 24 Jun 2009 10:15:01 -0700 schrieb spottedmahn:
Hi Ken, thanks again for the response.
Yes the both branches of that if else are being executed. I put a
breakpoint in each of them and stepped thru the code.
Here is a screen shot of what is happening:
http://spottedmahn.spaces.live.com/b...016B!407.entry
"Ken Slovak - [MVP - Outlook]" wrote:
The line that I see on a brief scan of the code that actually adds a new
category to the Categories collection is this:
this.olNS.Categories.Add(Cat.Name, Cat.Color, Cat.ShortcutKey);
Are you sure this line is actually being executed in your code? Maybe add
a
Debug.Writeline() call just before that line to verify it is being hit,
otherwise whatever you do won't persist.