How to modify the AppointmentItem.Parent object

不羁岁月 提交于 2019-12-12 05:13:57

问题


I need to set a UserProperty on a master of a recurring Appointment, from an appointment instance.

The scenario is: a. user opens an instance of a recurring meeting/appointment.
b. my program sets a UserProperty on the master of the appointment series

Getting the master appointment is easy with the Parent property, however it is read-only.

How can I get a modify-able reference to the master appointment?

The code I want to execute is along these lines

Outlook.AppointmentItem masterAppointment = (Outlook.AppointmentItem)(currentAppointment.Parent);
masterAppointment.ItemProperties.Add("xxx", Outlook.OlUserPropertyType.olText);
masterAppointment.ItemProperties["xxx"].Value = aStringValue;
masterAppointment.Save();

回答1:


What makes you think that AppointmentItem.Parent returns a read-only AppointmentItem?
Do you get an error when you call Save?
If you need to add a custom property, use AppointmentItem.UserProperties.Add.



来源:https://stackoverflow.com/questions/14788295/how-to-modify-the-appointmentitem-parent-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!