PC Review


Reply
Thread Tools Rate Thread

C#, Redemption, not able to set appointment color in Outlook 2003

 
 
Johan Machielse
Guest
Posts: n/a
 
      23rd Jul 2008
Dear reader,

I use the following piece of code to change the color of an appointment in
the calendar (appointment is of type Outlook.AppointmentItem). It does not
seem to work??? Any ideas what I am doing wrong?

Rdo.SafeAppointmentItem safe = new Rdo.SafeAppointmentItem();
safe.Item = appointment;
int propertyID = safe.GetIDsFromNames(
"{00062002-0000-0000-C000-000000000046}", 0x8214 );
propertyID = propertyID | 0x3;
safe.set_Fields( propertyID, color );
appointment.Save();

Thank you in advance!

Regards,

Johan Machielse
Avanade
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      23rd Jul 2008
Outlook doesn't know anything about changes you make to an item using
Extended MAPI (Redemption), so when you save the appointment your changes
are being ignored or overwritten.

Try this and see if it works better:

Rdo.SafeAppointmentItem safe = new Rdo.SafeAppointmentItem();
safe.Item = appointment;
int propertyID = safe.GetIDsFromNames(
"{00062002-0000-0000-C000-000000000046}", 0x8214 );
propertyID = propertyID | 0x3;
safe.set_Fields( propertyID, color );

appointment.Subject = appointment.Subject; // new code line

appointment.Save();


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


"Johan Machielse" <(E-Mail Removed)> wrote in
message newsB046F88-DF80-44A2-B535-(E-Mail Removed)...
> Dear reader,
>
> I use the following piece of code to change the color of an appointment in
> the calendar (appointment is of type Outlook.AppointmentItem). It does not
> seem to work??? Any ideas what I am doing wrong?
>
> Rdo.SafeAppointmentItem safe = new Rdo.SafeAppointmentItem();
> safe.Item = appointment;
> int propertyID = safe.GetIDsFromNames(
> "{00062002-0000-0000-C000-000000000046}", 0x8214 );
> propertyID = propertyID | 0x3;
> safe.set_Fields( propertyID, color );
> appointment.Save();
>
> Thank you in advance!
>
> Regards,
>
> Johan Machielse
> Avanade


 
Reply With Quote
 
Johan Machielse
Guest
Posts: n/a
 
      23rd Jul 2008
Ken,

It works great!

Thank you!

Mvg,

Johan Machielse
Avanade

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

> Outlook doesn't know anything about changes you make to an item using
> Extended MAPI (Redemption), so when you save the appointment your changes
> are being ignored or overwritten.
>
> Try this and see if it works better:
>
> Rdo.SafeAppointmentItem safe = new Rdo.SafeAppointmentItem();
> safe.Item = appointment;
> int propertyID = safe.GetIDsFromNames(
> "{00062002-0000-0000-C000-000000000046}", 0x8214 );
> propertyID = propertyID | 0x3;
> safe.set_Fields( propertyID, color );
>
> appointment.Subject = appointment.Subject; // new code line
>
> appointment.Save();
>
>
> --
> 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
>
>
> "Johan Machielse" <(E-Mail Removed)> wrote in
> message newsB046F88-DF80-44A2-B535-(E-Mail Removed)...
> > Dear reader,
> >
> > I use the following piece of code to change the color of an appointment in
> > the calendar (appointment is of type Outlook.AppointmentItem). It does not
> > seem to work??? Any ideas what I am doing wrong?
> >
> > Rdo.SafeAppointmentItem safe = new Rdo.SafeAppointmentItem();
> > safe.Item = appointment;
> > int propertyID = safe.GetIDsFromNames(
> > "{00062002-0000-0000-C000-000000000046}", 0x8214 );
> > propertyID = propertyID | 0x3;
> > safe.set_Fields( propertyID, color );
> > appointment.Save();
> >
> > Thank you in advance!
> >
> > Regards,
> >
> > Johan Machielse
> > Avanade

>
>

 
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
adding an appointment to another users calendar using redemption mjs11 Microsoft Outlook Program Addins 0 3rd Jul 2006 07:05 AM
Appointment RTF format problems using Redemption =?Utf-8?B?Sm9obiBTdmVyY2Vr?= Microsoft Outlook Program Addins 1 15th Jan 2006 11:41 PM
Setting Appointment Labels Using Redemption Mark Milliman Microsoft Outlook VBA Programming 11 6th Oct 2005 07:13 AM
Outlook Appointment Item + Redemption Security Warnings Ben Crinion Microsoft Outlook Program Addins 3 31st Jan 2005 12:25 PM
Can't set an appointment in Outlook 2003 - appointment window doe. =?Utf-8?B?dGliaWE0Z2I=?= Microsoft Outlook Calendar 0 5th Jan 2005 09:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:11 PM.