Search code examples
outlookoutlook-addinoutlook-web-addinsoutlook-2010outlook-2007

Outlook Add-In: AppointmentTimeChanged Event not getting triggered on changing the time of the event


I am trying to listen for any change in timing of the appointment through my Add-In. Here is the code where I am adding the handler.

Office.onReady(function() {
  mailboxItem = Office.context.mailbox.item;

  console.log("Added event handler");
  mailboxItem.addHandlerAsync(Office.EventType.AppointmentTimeChanged, args =>
      console.log("AppointmentTimeChanged")
  ),
  args => {
      console.log("Listening");
  };
});

This however is not working for me.


Solution

  • AppointmentTimeChanged event listener works only till the lifecycle of the add-in. If you are using UI-less add-in functions you will not receive notifications beyond your call to event.completed().

    To listen to changes beyond that you will have to listen to change using graph web hooks (https://learn.microsoft.com/en-us/graph/webhooks). This subscription from your backend service will enable you to be notified for event changes even from other clients.

    But there is a catch to it, Outlook for MAC does not provide way to listen these changes till the event is sent out. To work around this problem you can use custom properties and listener to changes with these properties. Here is the doc explaining it: https://learn.microsoft.com/en-us/outlook/troubleshoot/calendars/cannot-save-meeting-as-draft-in-outlook-for-mac.