Search code examples
vstooutlook-addin

VSTO:Prevent specific AppointmentItems to be converted to recurring AppointmentItems


I am trying to build a Outlook AddIn. In certain cases I want to know whether the user is trying to convert the current AppointmentItem to a recurring AppointmentItem. Is it possible to catch this event? Is it possible to prevent the event from happening in certain cases?

thanks


Solution

  • You can catch the AppointmentItem.PropertyChange("IsRecurring") event - it will fire whenever the recurrence pattern is changed. You can then prompt the user and call AppointmentItem.ClearRecurencePattern().

    AppointmentItem can be retrieved from Inspector.CurrentItem, and inspector can be retrieved from the Inspectors.NewInspector event.