cerating category in outlook 2003 from c#

H

hemaneelagiri

hi

i am uisng "Microsoft Outlook 11.0 Object Library" as refernce
and want to cerate new appointment in outlook 2003 with custom category and
with different color(label)

in outlook 2007 it is there with name sapce in that machine i am able to
cerate category and it is working properly
if (oNS.Categories["my cat"] == null)
{
oNS.Categories.Add("my cat", Microsoft.Office.Interop.Outlook.OlCategoryColor.
olCategoryColorDarkPurple, Microsoft.Office.Interop.Outlook.
OlCategoryShortcutKey.olCategoryShortcutKeyNone);
}
oAppointment.Categories = oAppointment.Categories + ";" + "my cat";


please help me
 
T

Tobias Böhm

hi

i am uisng "Microsoft Outlook 11.0 Object Library" as refernce
and want to cerate new appointment in outlook 2003 with custom category and
with different color(label)

in outlook 2007 it is there with name sapce in that machine i am able to
cerate category and  it is working properly
if (oNS.Categories["my cat"] == null)
{
oNS.Categories.Add("my cat", Microsoft.Office.Interop.Outlook.OlCategoryColor.
olCategoryColorDarkPurple, Microsoft.Office.Interop.Outlook.
OlCategoryShortcutKey.olCategoryShortcutKeyNone);}

oAppointment.Categories = oAppointment.Categories + ";" + "my cat";

please help me

Outlook 2007 categories seem to work a bit differently. Before that
categories were kept in the registry. See http://www.slipstick.com/outlook/olcat.asp.
Does that help?
 
H

hemaneelagiri

hi thanks for ur reply.
in my registry i am not able to find category key in HKEY_CURRENT_USER\
Software\Microsoft\Office\11.0\Outlook


and i need create new category from C# in outlook 2003 and want to apply
label ,when i select that category
for new appointment(which is from my code) should be in that lable color.

Thanks


[quoted text clipped - 13 lines]
please help me

Outlook 2007 categories seem to work a bit differently. Before that
categories were kept in the registry. See http://www.slipstick.com/outlook/olcat.asp.
Does that help?
 
T

Tobias Böhm

hi thanks for ur reply.
in my registry i am not able to find category key in HKEY_CURRENT_USER\
Software\Microsoft\Office\11.0\Outlook

and i need create new category from C# in outlook 2003 and want to apply
label ,when i select that category
for new  appointment(which is from my code)  should be in that lable color.

Thanks
[quoted text clipped - 13 lines]
please help me
Outlook 2007 categories seem to work a bit differently. Before that
categories were kept in the registry. Seehttp://www.slipstick.com/outlook/olcat.asp.
Does that help?

Ok, the "Category" key appeared once I manually added a category in
Outlook's category manager. Anyone an idea why this is the case? Where
does Outlook find the categories before that?

If you want to change the appointment item depending on the category
you could use the event that gets fired when an item is created. There
you check if the category is your custom one and then modify the item
accordingly.
 
H

hemaneelagiri

not like that i want to apply label for my newly cerated appointment.
when i give like this
oAppointment.Categories = oAppointment.Categories + ";" + "my new" + ";" +
"Business";
oAppointment.Save();

when i check the appointment in outlook category is coming in cateogry box,
but it is showing "my new ( not in master category list)"
means it is not adding master category list.
when i give category is business ven though the appointment is not is
business color

how can i select business label color

Thanks


hi thanks for ur reply.
in my registry i am not able to find category key in HKEY_CURRENT_USER\
[quoted text clipped - 15 lines]
Ok, the "Category" key appeared once I manually added a category in
Outlook's category manager. Anyone an idea why this is the case? Where
does Outlook find the categories before that?

If you want to change the appointment item depending on the category
you could use the event that gets fired when an item is created. There
you check if the category is your custom one and then modify the item
accordingly.
 
M

Michael Bauer [MVP - Outlook]

In Outlook 2003 the master category list won't be added to the registry
before you add the first item of your own. And adding a category directly to
an item by code doesn't put it into the master list. That is you always have
to write that yourself into the registry. See this for some more details:

http://www.vboffice.net/workshop.html?pub=6&lang=en&smp=1&cmd=showitem#t6

No matter how you add a category in Outlook 2003, that has nothing to do
with the color labels for appointments. Labels aren't exposed by the Outlook
object model. Here's an example for how to add labels:

http://www.vboffice.net/sample.html?mnu=2&pub=6&lang=en&smp=55&cmd=showitem

--
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 Thu, 20 Aug 2009 08:38:52 GMT schrieb hemaneelagiri:
not like that i want to apply label for my newly cerated appointment.
when i give like this
oAppointment.Categories = oAppointment.Categories + ";" + "my new" + ";" +
"Business";
oAppointment.Save();

when i check the appointment in outlook category is coming in cateogry box,
but it is showing "my new ( not in master category list)"
means it is not adding master category list.
when i give category is business ven though the appointment is not is
business color

how can i select business label color

Thanks


hi thanks for ur reply.
in my registry i am not able to find category key in HKEY_CURRENT_USER\
[quoted text clipped - 15 lines]
categories were kept in the registry. Seehttp://www.slipstick.com/outlook/olcat.asp.
Does that help?

Ok, the "Category" key appeared once I manually added a category in
Outlook's category manager. Anyone an idea why this is the case? Where
does Outlook find the categories before that?

If you want to change the appointment item depending on the category
you could use the event that gets fired when an item is created. There
you check if the category is your custom one and then modify the item
accordingly.
 
H

hemaneelagiri

:( but that is control, can't v set with code not using any controls

In Outlook 2003 the master category list won't be added to the registry
before you add the first item of your own. And adding a category directly to
an item by code doesn't put it into the master list. That is you always have
to write that yourself into the registry. See this for some more details:

http://www.vboffice.net/workshop.html?pub=6&lang=en&smp=1&cmd=showitem#t6

No matter how you add a category in Outlook 2003, that has nothing to do
with the color labels for appointments. Labels aren't exposed by the Outlook
object model. Here's an example for how to add labels:

http://www.vboffice.net/sample.html?mnu=2&pub=6&lang=en&smp=55&cmd=showitem
not like that i want to apply label for my newly cerated appointment.
when i give like this
[quoted text clipped - 26 lines]
 
M

Michael Bauer [MVP - Outlook]

Not sure if I understand you. You don't have to use any controls or third
party software. As for the label appointment example, instead of using the
Redemption you can also use CDO 1.21, which comes with your Outlook.

--
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 Thu, 20 Aug 2009 10:43:46 GMT schrieb hemaneelagiri:
:( but that is control, can't v set with code not using any controls

In Outlook 2003 the master category list won't be added to the registry
before you add the first item of your own. And adding a category directly to
an item by code doesn't put it into the master list. That is you always have
to write that yourself into the registry. See this for some more details:

http://www.vboffice.net/workshop.html?pub=6&lang=en&smp=1&cmd=showitem#t6

No matter how you add a category in Outlook 2003, that has nothing to do
with the color labels for appointments. Labels aren't exposed by the Outlook
object model. Here's an example for how to add labels:

http://www.vboffice.net/sample.html?mnu=2&pub=6&lang=en&smp=55&cmd=showitem
not like that i want to apply label for my newly cerated appointment.
when i give like this
[quoted text clipped - 26 lines]
you check if the category is your custom one and then modify the item
accordingly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top