PC Review


Reply
Thread Tools Rate Thread

Categories Not Saved

 
 
spottedmahn
Guest
Posts: n/a
 
      22nd Jun 2009
I'm updating my categories in code using the Com objects and I see the
changes in Outlook but when I close and re-open the changes are not there.

More detailed description:
-Outlook 2007 running
-Start my app
-Run code to update the category colors and shortkeys
-I see the color changes in Outlook
-Close my app
-Close Outlook
-Reopen Outlook, changes are gone.
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      23rd Jun 2009

It's hard to tell what you're doing without seeing any code, but are you
saving whatever changes you're making?

--
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


"spottedmahn" <(E-Mail Removed)> wrote in message
news:8214421F-188B-49BD-9C9C-(E-Mail Removed)...
> I'm updating my categories in code using the Com objects and I see the
> changes in Outlook but when I close and re-open the changes are not there.
>
> More detailed description:
> -Outlook 2007 running
> -Start my app
> -Run code to update the category colors and shortkeys
> -I see the color changes in Outlook
> -Close my app
> -Close Outlook
> -Reopen Outlook, changes are gone.


 
Reply With Quote
 
spottedmahn
Guest
Posts: n/a
 
      23rd Jun 2009

Hi Ken, thanks for the response.

How do I save the changes?

Here is most of the code... please let me know if this is not enough.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Outlook = Microsoft.Office.Interop.Outlook;

namespace OutlookCategoryHelper
{
public class OutlookCategoriesHelper
{
string OutlookNameSpace = "MAPI";

Outlook._Application olApp;
Outlook._NameSpace olNS;

public OutlookCategoriesHelper(Outlook.ApplicationClass AppIn)
{
this.olApp = AppIn;
this.olNS = olApp.GetNamespace(this.OutlookNameSpace);
}

//todo maybe need to create excel program with drop downs,
//copy paste to a tab delimited, lookup enums by name

string CatInvestAndBankingName = "Investments and Banking";
Outlook.OlCategoryColor CatInvestAndBankingColor =
Outlook.OlCategoryColor.olCategoryColorOlive;
Outlook.OlCategoryShortcutKey CatInvestAndBankingKey =
Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;

string CatSifCloseParnersName = "SIF - Close Partners";
Outlook.OlCategoryColor CatSifCloseParnersColor =
Outlook.OlCategoryColor.olCategoryColorSteel;
Outlook.OlCategoryShortcutKey CatSifCloseParnersKey =
Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;

string CatSifFrsaUsisName = "SIF - FRSA USIS";
Outlook.OlCategoryColor CatSifFrsaUsisColor =
Outlook.OlCategoryColor.olCategoryColorBlue;
Outlook.OlCategoryShortcutKey CatSifFrsaUsisKey =
Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;

string CatSifMembersName = "SIF - Members";
Outlook.OlCategoryColor CatSifMemberColor =
Outlook.OlCategoryColor.olCategoryColorRed;
Outlook.OlCategoryShortcutKey CatSifMemberKey =
Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyCtrlF2;

string CatSifVendorsName = "SIF - Vendor";
Outlook.OlCategoryColor CatSifVendorsColor =
Outlook.OlCategoryColor.olCategoryColorOrange;
Outlook.OlCategoryShortcutKey CatSifVendorsKey =
Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;

string CatTech3rdPartyName = "Tech - 3rd Party Rpting";
Outlook.OlCategoryColor CatTech3rdPartyColor =
Outlook.OlCategoryColor.olCategoryColorMaroon;
Outlook.OlCategoryShortcutKey CatTech3rdPartyKey =
Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;

string CatTechDevName = "Tech - Dev";
Outlook.OlCategoryColor CatTechDevColor =
Outlook.OlCategoryColor.olCategoryColorGreen;
Outlook.OlCategoryShortcutKey CatTechDevKey =
Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;

string CatTechSuportName = "Tech - Support";
Outlook.OlCategoryColor CatTechSupportColor =
Outlook.OlCategoryColor.olCategoryColorYellow;
Outlook.OlCategoryShortcutKey CatTechSupportKey =
Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;

public List<OutlookCategory> SifCategories
{
get
{
List<OutlookCategory> Results = new List<OutlookCategory>();

string Name;
Outlook.OlCategoryColor Color;
Outlook.OlCategoryShortcutKey Key;
OutlookCategory Cat;

//Investment and Banking
Name = this.CatInvestAndBankingName;
Color = this.CatInvestAndBankingColor;
Key = this.CatInvestAndBankingKey;
Cat = CreateNewOutlookCategory(Name, Color, Key);
Results.Add(Cat);

//SIF - Close Partners
Name = this.CatSifCloseParnersName;
Color = this.CatSifCloseParnersColor;
Key = this.CatSifCloseParnersKey;
Cat = CreateNewOutlookCategory(Name, Color, Key);
Results.Add(Cat);

//SIF - Members
Name = this.CatSifMembersName;
Color = this.CatSifMemberColor;
Key = this.CatSifMemberKey;
Cat = CreateNewOutlookCategory(Name, Color, Key);
Results.Add(Cat);

//SIF - FRSA USIS
Name = this.CatSifFrsaUsisName;
Color = this.CatSifFrsaUsisColor;
Key = this.CatSifFrsaUsisKey;
Cat = CreateNewOutlookCategory(Name, Color, Key);
Results.Add(Cat);

//SIF - Vendors
Name = this.CatSifVendorsName;
Color = this.CatSifVendorsColor;
Key = this.CatSifVendorsKey;
Cat = CreateNewOutlookCategory(Name, Color, Key);
Results.Add(Cat);

//Tech - 3rd Party Reporting
Name = this.CatTech3rdPartyName;
Color = this.CatTech3rdPartyColor;
Key = this.CatTech3rdPartyKey;
Cat = CreateNewOutlookCategory(Name, Color, Key);
Results.Add(Cat);

//Tech - Support
Name = this.CatTechSuportName;
Color = this.CatTechSupportColor;
Key = this.CatTechSupportKey;
Cat = CreateNewOutlookCategory(Name, Color, Key);
Results.Add(Cat);

//Tech - Dev
Name = this.CatTechDevName;
Color = this.CatTechDevColor;
Key = this.CatTechDevKey;
Cat = CreateNewOutlookCategory(Name, Color, Key);
Results.Add(Cat);

//blank
//
//Color = this.Cat;
//Key = this.Cat;
//Name = this.Cat;
//Cat = CreateNewOutlookCategory(Name, Color, Key);

//Results.Add(Cat);

return Results;

}
}

private OutlookCategory CreateNewOutlookCategory(string NameIn,
Outlook.OlCategoryColor olCategoryColorIn, Outlook.OlCategoryShortcutKey
olCategoryShortcutKeyIn)
{
OutlookCategory Result = new OutlookCategory();

Result.Color = olCategoryColorIn;
Result.ShortcutKey = olCategoryShortcutKeyIn;
Result.Name = NameIn;

return Result;
}

public IEnumerable<Outlook.Category> CategoriesList
{
get
{
Outlook.Categories Cats = this.olNS.Categories;

//foreach (Outlook.Category item in Cats)
//{

//}

IEnumerable<Outlook.Category> Results =
Cats.Cast<Outlook.Category>();

//List<Outlook.Category> ResultsT = Results.ToList();

return Results;
}
}

public void CreateOrUpdateSifCategories()
{
foreach (OutlookCategory Cat in this.SifCategories)
{
CreateOrUpdateSifCategory(Cat);
}


}

private void CreateOrUpdateSifCategory(OutlookCategory Cat)
{
var Query = this.CategoriesList.Where(x =>
x.Name.Equals(Cat.Name));

if (Query.Any())
{
Outlook._Category OCat = Query.Take(1).Single();
OCat.Color = Cat.Color;
OCat.ShortcutKey = Cat.ShortcutKey;
}
else
{
this.olNS.Categories.Add(Cat.Name, Cat.Color,
Cat.ShortcutKey);
}
}

}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Outlook = Microsoft.Office.Interop.Outlook;

namespace OutlookCategoryHelper
{
public class OutlookCategory
{
public string Name { get; set; }
public Outlook.OlCategoryColor Color { get; set; }
public Outlook.OlCategoryShortcutKey ShortcutKey { get; set; }
}
}

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

> It's hard to tell what you're doing without seeing any code, but are you
> saving whatever changes you're making?
>
> --
> 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
>
>
> "spottedmahn" <(E-Mail Removed)> wrote in message
> news:8214421F-188B-49BD-9C9C-(E-Mail Removed)...
> > I'm updating my categories in code using the Com objects and I see the
> > changes in Outlook but when I close and re-open the changes are not there.
> >
> > More detailed description:
> > -Outlook 2007 running
> > -Start my app
> > -Run code to update the category colors and shortkeys
> > -I see the color changes in Outlook
> > -Close my app
> > -Close Outlook
> > -Reopen Outlook, changes are gone.

>
>

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      23rd Jun 2009

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.


--
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


"spottedmahn" <(E-Mail Removed)> wrote in message
news8B059A4-2615-458A-8A84-(E-Mail Removed)...
> Hi Ken, thanks for the response.
>
> How do I save the changes?
>
> Here is most of the code... please let me know if this is not enough.
>
> using System;
> using System.Collections.Generic;
> using System.Linq;
> using System.Text;
>
> using Outlook = Microsoft.Office.Interop.Outlook;
>
> namespace OutlookCategoryHelper
> {
> public class OutlookCategoriesHelper
> {
> string OutlookNameSpace = "MAPI";
>
> Outlook._Application olApp;
> Outlook._NameSpace olNS;
>
> public OutlookCategoriesHelper(Outlook.ApplicationClass AppIn)
> {
> this.olApp = AppIn;
> this.olNS = olApp.GetNamespace(this.OutlookNameSpace);
> }
>
> //todo maybe need to create excel program with drop downs,
> //copy paste to a tab delimited, lookup enums by name
>
> string CatInvestAndBankingName = "Investments and Banking";
> Outlook.OlCategoryColor CatInvestAndBankingColor =
> Outlook.OlCategoryColor.olCategoryColorOlive;
> Outlook.OlCategoryShortcutKey CatInvestAndBankingKey =
> Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;
>
> string CatSifCloseParnersName = "SIF - Close Partners";
> Outlook.OlCategoryColor CatSifCloseParnersColor =
> Outlook.OlCategoryColor.olCategoryColorSteel;
> Outlook.OlCategoryShortcutKey CatSifCloseParnersKey =
> Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;
>
> string CatSifFrsaUsisName = "SIF - FRSA USIS";
> Outlook.OlCategoryColor CatSifFrsaUsisColor =
> Outlook.OlCategoryColor.olCategoryColorBlue;
> Outlook.OlCategoryShortcutKey CatSifFrsaUsisKey =
> Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;
>
> string CatSifMembersName = "SIF - Members";
> Outlook.OlCategoryColor CatSifMemberColor =
> Outlook.OlCategoryColor.olCategoryColorRed;
> Outlook.OlCategoryShortcutKey CatSifMemberKey =
> Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyCtrlF2;
>
> string CatSifVendorsName = "SIF - Vendor";
> Outlook.OlCategoryColor CatSifVendorsColor =
> Outlook.OlCategoryColor.olCategoryColorOrange;
> Outlook.OlCategoryShortcutKey CatSifVendorsKey =
> Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;
>
> string CatTech3rdPartyName = "Tech - 3rd Party Rpting";
> Outlook.OlCategoryColor CatTech3rdPartyColor =
> Outlook.OlCategoryColor.olCategoryColorMaroon;
> Outlook.OlCategoryShortcutKey CatTech3rdPartyKey =
> Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;
>
> string CatTechDevName = "Tech - Dev";
> Outlook.OlCategoryColor CatTechDevColor =
> Outlook.OlCategoryColor.olCategoryColorGreen;
> Outlook.OlCategoryShortcutKey CatTechDevKey =
> Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;
>
> string CatTechSuportName = "Tech - Support";
> Outlook.OlCategoryColor CatTechSupportColor =
> Outlook.OlCategoryColor.olCategoryColorYellow;
> Outlook.OlCategoryShortcutKey CatTechSupportKey =
> Outlook.OlCategoryShortcutKey.olCategoryShortcutKeyNone;
>
> public List<OutlookCategory> SifCategories
> {
> get
> {
> List<OutlookCategory> Results = new
> List<OutlookCategory>();
>
> string Name;
> Outlook.OlCategoryColor Color;
> Outlook.OlCategoryShortcutKey Key;
> OutlookCategory Cat;
>
> //Investment and Banking
> Name = this.CatInvestAndBankingName;
> Color = this.CatInvestAndBankingColor;
> Key = this.CatInvestAndBankingKey;
> Cat = CreateNewOutlookCategory(Name, Color, Key);
> Results.Add(Cat);
>
> //SIF - Close Partners
> Name = this.CatSifCloseParnersName;
> Color = this.CatSifCloseParnersColor;
> Key = this.CatSifCloseParnersKey;
> Cat = CreateNewOutlookCategory(Name, Color, Key);
> Results.Add(Cat);
>
> //SIF - Members
> Name = this.CatSifMembersName;
> Color = this.CatSifMemberColor;
> Key = this.CatSifMemberKey;
> Cat = CreateNewOutlookCategory(Name, Color, Key);
> Results.Add(Cat);
>
> //SIF - FRSA USIS
> Name = this.CatSifFrsaUsisName;
> Color = this.CatSifFrsaUsisColor;
> Key = this.CatSifFrsaUsisKey;
> Cat = CreateNewOutlookCategory(Name, Color, Key);
> Results.Add(Cat);
>
> //SIF - Vendors
> Name = this.CatSifVendorsName;
> Color = this.CatSifVendorsColor;
> Key = this.CatSifVendorsKey;
> Cat = CreateNewOutlookCategory(Name, Color, Key);
> Results.Add(Cat);
>
> //Tech - 3rd Party Reporting
> Name = this.CatTech3rdPartyName;
> Color = this.CatTech3rdPartyColor;
> Key = this.CatTech3rdPartyKey;
> Cat = CreateNewOutlookCategory(Name, Color, Key);
> Results.Add(Cat);
>
> //Tech - Support
> Name = this.CatTechSuportName;
> Color = this.CatTechSupportColor;
> Key = this.CatTechSupportKey;
> Cat = CreateNewOutlookCategory(Name, Color, Key);
> Results.Add(Cat);
>
> //Tech - Dev
> Name = this.CatTechDevName;
> Color = this.CatTechDevColor;
> Key = this.CatTechDevKey;
> Cat = CreateNewOutlookCategory(Name, Color, Key);
> Results.Add(Cat);
>
> //blank
> //
> //Color = this.Cat;
> //Key = this.Cat;
> //Name = this.Cat;
> //Cat = CreateNewOutlookCategory(Name, Color, Key);
>
> //Results.Add(Cat);
>
> return Results;
>
> }
> }
>
> private OutlookCategory CreateNewOutlookCategory(string NameIn,
> Outlook.OlCategoryColor olCategoryColorIn, Outlook.OlCategoryShortcutKey
> olCategoryShortcutKeyIn)
> {
> OutlookCategory Result = new OutlookCategory();
>
> Result.Color = olCategoryColorIn;
> Result.ShortcutKey = olCategoryShortcutKeyIn;
> Result.Name = NameIn;
>
> return Result;
> }
>
> public IEnumerable<Outlook.Category> CategoriesList
> {
> get
> {
> Outlook.Categories Cats = this.olNS.Categories;
>
> //foreach (Outlook.Category item in Cats)
> //{
>
> //}
>
> IEnumerable<Outlook.Category> Results =
> Cats.Cast<Outlook.Category>();
>
> //List<Outlook.Category> ResultsT = Results.ToList();
>
> return Results;
> }
> }
>
> public void CreateOrUpdateSifCategories()
> {
> foreach (OutlookCategory Cat in this.SifCategories)
> {
> CreateOrUpdateSifCategory(Cat);
> }
>
>
> }
>
> private void CreateOrUpdateSifCategory(OutlookCategory Cat)
> {
> var Query = this.CategoriesList.Where(x =>
> x.Name.Equals(Cat.Name));
>
> if (Query.Any())
> {
> Outlook._Category OCat = Query.Take(1).Single();
> OCat.Color = Cat.Color;
> OCat.ShortcutKey = Cat.ShortcutKey;
> }
> else
> {
> this.olNS.Categories.Add(Cat.Name, Cat.Color,
> Cat.ShortcutKey);
> }
> }
>
> }
> }
>
> using System;
> using System.Collections.Generic;
> using System.Linq;
> using System.Text;
>
> using Outlook = Microsoft.Office.Interop.Outlook;
>
> namespace OutlookCategoryHelper
> {
> public class OutlookCategory
> {
> public string Name { get; set; }
> public Outlook.OlCategoryColor Color { get; set; }
> public Outlook.OlCategoryShortcutKey ShortcutKey { get; set; }
> }
> }
>


 
Reply With Quote
 
spottedmahn
Guest
Posts: n/a
 
      24th Jun 2009

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/blog/cns!CF657615B69F016B!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.
>


 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      25th Jun 2009

When I get a chance I'll load your code and see what results I get.

--
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


"spottedmahn" <(E-Mail Removed)> wrote in message
news:C93D1ED2-E1BA-4723-90BB-(E-Mail Removed)...
> 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/blog/cns!CF657615B69F016B!407.entry
>


 
Reply With Quote
 
Manfred
Guest
Posts: n/a
 
      26th Jun 2009

Hi all,

we have a similar problem. We are using two vb-scripts, the first one to
delete all existing categories and a second one to "install" our predefined
categories. The two scripts were working since Jan/Feb 2009 with Outlook 2007
SP1. It seems that the scripts for the categories are not working anymore
since installing Office 2007 SP2.

We have the same symptoms:
- Outlook 2007 running
- Run one of our vb-script (delete categories or install categories)
- I see all categories deleted and then all our custom predefined categories
- Close Outlook
- Reopen Outlook
- All changes in categories are gone.

Any idea or solution?

Manfred


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

> When I get a chance I'll load your code and see what results I get.
>
> --
> 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
>
>
> "spottedmahn" <(E-Mail Removed)> wrote in message
> news:C93D1ED2-E1BA-4723-90BB-(E-Mail Removed)...
> > 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/blog/cns!CF657615B69F016B!407.entry
> >

>
>

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      26th Jun 2009

As I said to the other poster, I can't repro this problem here on a couple
of Outlook 2007 SP2 systems. I plan to test the poster's code when I get a
chance to see what's going on. All I can say is that I have my own addin
code that completely changes the categories list and it continues to work on
SP2.

If I do turn up a but created by SP2 I'll report it to MS, but that won't
help until or if MS fixes the problem.

--
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


"Manfred" <(E-Mail Removed)> wrote in message
news:2D23D9C7-3F9C-4AF6-8C17-(E-Mail Removed)...
> Hi all,
>
> we have a similar problem. We are using two vb-scripts, the first one to
> delete all existing categories and a second one to "install" our
> predefined
> categories. The two scripts were working since Jan/Feb 2009 with Outlook
> 2007
> SP1. It seems that the scripts for the categories are not working anymore
> since installing Office 2007 SP2.
>
> We have the same symptoms:
> - Outlook 2007 running
> - Run one of our vb-script (delete categories or install categories)
> - I see all categories deleted and then all our custom predefined
> categories
> - Close Outlook
> - Reopen Outlook
> - All changes in categories are gone.
>
> Any idea or solution?
>
> Manfred


 
Reply With Quote
 
Michael Bauer [MVP - Outlook]
Guest
Posts: n/a
 
      27th Jun 2009



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/blog/cns!CF657615B69F016B!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.
>>

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      29th Jun 2009

Good thinking, Michael, I hadn't thought of IMAP or any HTTP based stores
where the PST is just a mirror into that server. None of those would support
persisting categories. Nor would a BCM store unless the BCM database
supported synching up categories.

--
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


"Michael Bauer [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:19d61k9i8yt5n$.1vr7v5u46lygc$.(E-Mail Removed)...
>
>
> 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>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Customizing Microsoft Categories - Disable ability for users toremove categories applied to messages jrattan@gmail.com Microsoft Outlook Discussion 1 31st Mar 2010 04:20 AM
Categories not saved for sent/replied/forwarded messages (O2K7) Lillo Ramos, Alex Microsoft Outlook 3 29th Jun 2007 08:53 AM
Creating saved search that lists all categories? Jason Windows Vista File Management 0 17th Mar 2007 04:07 AM
Re: Where are Outlook categories saved Sue Mosher [MVP-Outlook] Microsoft Outlook Discussion 0 3rd Jan 2007 12:57 AM
Select Categories and statistics from a table of Categories and Products (Excel 2000) L Mehl Microsoft Excel Discussion 2 30th Aug 2004 10:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:06 PM.