![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
I have a C# COM Add-in for Outlook 2007 that adds categories to mail messages programmatically. I use mapiNameSpace.Categories.Add method to add the category to the Master Category List and the Categories property of the MailItem to assign the category to the mail. This works fine and the category is successfully added to the mail and to the Master Category List. However, when Outlook 2007 is restarted only the category assigned to the mail is persisted. The category disappears from the Master Category List. I am using Outlook 2007 SP2 with Exchange account. Has anyone encountered this issue before? I found very little information on the net about Outlook categories, so any hint is highly appreciated. Thanks, Teodora Gancheva |
Ads |
#2
|
|||
|
|||
![]()
Show the code you're using.
-- 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" Teodora Gancheva @discussions.microsoft.com wrote in message ... Hi, I have a C# COM Add-in for Outlook 2007 that adds categories to mail messages programmatically. I use mapiNameSpace.Categories.Add method to add the category to the Master Category List and the Categories property of the MailItem to assign the category to the mail. This works fine and the category is successfully added to the mail and to the Master Category List. However, when Outlook 2007 is restarted only the category assigned to the mail is persisted. The category disappears from the Master Category List. I am using Outlook 2007 SP2 with Exchange account. Has anyone encountered this issue before? I found very little information on the net about Outlook categories, so any hint is highly appreciated. Thanks, Teodora Gancheva |
#3
|
|||
|
|||
![]()
This is how I add the category to Outlook category list:
NameSpace mapiNameSpace = outlook.GetNamespace("MAPI"); mapiNameSpace.Categories.Add(categoryName, OlCategoryColor.olCategoryColorNone, OlCategoryShortcutKey.olCategoryShortcutKeyNone); And then I assign the category to the MailItem: mail.Categories = categoryName; mail.Save(); Thanks, Teodora Gancheva "Ken Slovak - [MVP - Outlook]" wrote: Show the code you're using. -- 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" Teodora Gancheva @discussions.microsoft.com wrote in message ... Hi, I have a C# COM Add-in for Outlook 2007 that adds categories to mail messages programmatically. I use mapiNameSpace.Categories.Add method to add the category to the Master Category List and the Categories property of the MailItem to assign the category to the mail. This works fine and the category is successfully added to the mail and to the Master Category List. However, when Outlook 2007 is restarted only the category assigned to the mail is persisted. The category disappears from the Master Category List. I am using Outlook 2007 SP2 with Exchange account. Has anyone encountered this issue before? I found very little information on the net about Outlook categories, so any hint is highly appreciated. Thanks, Teodora Gancheva |
#4
|
|||
|
|||
![]()
I'm seeing it as a bug, it's not persisting here either. Structure your code
so you add that custom category when your code starts up. I'll report it to MS and see what they say. -- 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 ... This is how I add the category to Outlook category list: NameSpace mapiNameSpace = outlook.GetNamespace("MAPI"); mapiNameSpace.Categories.Add(categoryName, OlCategoryColor.olCategoryColorNone, OlCategoryShortcutKey.olCategoryShortcutKeyNone); And then I assign the category to the MailItem: mail.Categories = categoryName; mail.Save(); Thanks, Teodora Gancheva |
#5
|
|||
|
|||
![]()
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 "Ken Slovak - [MVP - Outlook]" wrote: I'm seeing it as a bug, it's not persisting here either. Structure your code so you add that custom category when your code starts up. I'll report it to MS and see what they say. -- 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 ... This is how I add the category to Outlook category list: NameSpace mapiNameSpace = outlook.GetNamespace("MAPI"); mapiNameSpace.Categories.Add(categoryName, OlCategoryColor.olCategoryColorNone, OlCategoryShortcutKey.olCategoryShortcutKeyNone); And then I assign the category to the MailItem: mail.Categories = categoryName; mail.Save(); Thanks, Teodora Gancheva |
#6
|
|||
|
|||
![]()
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 |
#7
|
|||
|
|||
![]()
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 |
#8
|
|||
|
|||
![]()
It looks like there's a hot fix available for this issue (among others). A
fellow MVP pointed me to this link: http://support.microsoft.com/default.aspx/kb/970944/en -- 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 ... Thanks a lot, all the information has been really helpful. |
#9
|
|||
|
|||
![]()
Installing the hotfix resolved the issue.
Thanks, Teodora Gancheva "Ken Slovak - [MVP - Outlook]" wrote: It looks like there's a hot fix available for this issue (among others). A fellow MVP pointed me to this link: http://support.microsoft.com/default.aspx/kb/970944/en -- 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 ... Thanks a lot, all the information has been really helpful. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook does not remember passwords between sessions | Brian@Hastings | Outlook - Installation | 2 | February 14th 09 09:17 PM |
Outlook 2007 Categories are a combo of Categories & Labels in 2003 | Scott Sherman | Outlook - Calandaring | 0 | February 13th 07 04:23 AM |
3 Outlook sessions open w/o starting app? | jaug07 | Outlook - Installation | 3 | January 25th 07 04:33 PM |
Running two sessions of Outlook... | Ivan T Williams | Outlook - General Queries | 3 | January 4th 07 02:45 PM |