有没有办法在Outlook Web加载项中关闭当前Taskpane?
我想知道是否有一种方法可以在 Outlook Web 加载项中以编程方式关闭任务窗格。
我点击了此链接: https ://learn.microsoft.com/en-us/office/dev/add-ins/develop/show-hide-add-in
但是 Office.addin.hide()
和Office.addin.showAsTaskpane()
不起作用。
有人可以帮助我吗?
I was wondering if there was a way to close a taskpane programmatically in an outlook web add-in.
I followed this link : https://learn.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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 Office.context.ui.closeContainer() 关闭正在执行 JavaScript 的 UI 容器。
此方法的行为由以下内容指定:
从无 UI 命令按钮调用:无效果。
displayDialogAsync
打开的任何对话框都将保持打开状态。从任务窗格调用:任务窗格将关闭。由
displayDialogAsync
打开的任何对话框也将关闭。如果任务窗格支持固定并且已被用户固定,则它将被取消固定。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.@OutlookAdd-Insteam-Msft回答了我的问题。
您只需要使用:
office.context.ui.closecontainer()
@OutlookAdd-insTeam-MSFT answered my question.
You simply have to use:
Office.context.ui.closeContainer()