Outlook Addin: Moving Appointment in Calendar does not reflect new date/time in AppointmentItem (catch Calendar.ItemChange)

青春壹個敷衍的年華 提交于 2020-04-18 07:14:29

问题


i am trying to develop an Outlook Addin which updates a web services whenevery the ser moves an appointment (with drag and drop) in his calendar. In my VSTO based Outlook Addin (in Outlook 2016) my Item_Change gets fired when the user moves the calendar item around. But when I inspect the AppointmentItem which I get as a parameter of the call to

public void Item_Change(Object item)
{
    Outlook.AppointmentItem myAppointment = item as Outlook.AppointmentItem;                        

the myAppointment.StartUTC still shows the old value instead of the value (date/time) where the user has moved the item.

Does anyone know how to retrieve the new date/time of a moved AppointmentItem?

Thanks in advance


回答1:


Not using the Outlook Objector Model - it likes caching old stale values. All items are affected, but appointments are the worst - sometimes you would also need to change the current folder and come back. You would need to release the item in question, open another item, and only then open this item by its entry id. The problem you cannot do that from the event handler of the item that raises the event.

Your only other options are Extended MAPI (C++ or Delphi only) or Redemption.



来源:https://stackoverflow.com/questions/57339408/outlook-addin-moving-appointment-in-calendar-does-not-reflect-new-date-time-in

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