-->

Close Outlook Add In From Inside Application

2019-02-20 14:16发布

问题:

I have an Outlook Office Add-in built using Angular which is utilizing the Office.js library. The purpose of the add-in is to perform a one-time action for the message currently being displayed. Once the submit button is clicked for the action in the add-in, there is no need to have the add-in open anymore.

Is there a way to close the add-in frame altogether from inside the application? For instance, something like Office.close();.

回答1:

This can be done using the UI.closeContainer method:

Office.context.ui.closeContainer();