I was wondering if there was a way to close a taskpane programmatically in an outlook web add-in.
I followed this link : https://docs.microsoft.com/en-us/office/dev/add-ins/develop/show-hide-add-in
But Office.addin.hide()
and Office.addin.showAsTaskpane()
are not working.
Can someone help me?
CodePudding user response:
@OutlookAdd-insTeam-MSFT answered my question.
You simply have to use: Office.context.ui.closeContainer()
CodePudding user response:
Use the Office.context.ui.closeContainer() which closes the UI container where the JavaScript is executing.
The behavior of this method is specified by the following:
Called from a UI-less command button: No effect. Any dialog opened by
displayDialogAsync
will remain open.Called from a task pane: The task pane will close. Any dialog opened by
displayDialogAsync
will also close. If the task pane supports pinning and was pinned by the user, it will be un-pinned.