Search code examples
office-addinsoutlook-web-addins

How to prevent On Send add-in errors when user clicks elsewhere?


I've created an outlook add-in with the "On-Send feature" as described here.

Everything works fine on the web version of Outlook, but on the desktop there are some issues.

When a user sends a message and then quickly selects another message, the send action fails and the user gets this error.

An add-in prevented this message from being sent. It will be saved as a draft.

If the reply is popped out, the user gets a different error.

Add-ins are still running on this message. The message won't be sent until the add-in completes. Do you want to wait for them to finish?

Testing the Microsoft sample application demonstrates these same issues.

How can these behaviors, or at least the first error, be avoided?


Solution

  • These errors are valid, and aren't able to be avoided. If your add-in hasn't finished, and the user closes the item, then they are warned the email hasn't actually been sent yet. Please be sure that your add-in calls event.completed() to notify Outlook your add-in action has completed.