![]() |
C#, Redemption, not able to set appointment color in Outlook 2003
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 |
C#, Redemption, not able to set appointment color in Outlook 2003
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" wrote in message ... 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 |
C#, Redemption, not able to set appointment color in Outlook 2
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" wrote in message ... 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 |
All times are GMT +1. The time now is 12:28 PM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com