防止在保存过程中关闭任务窗格(异步) [英] prevent task pane from closing during saving (async)

查看:85
本文介绍了防止在保存过程中关闭任务窗格(异步)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用OfficeJs REST API进行外接程序开发. 要使用此API,需要一个访问令牌,我们通过调用Office.mailbox.getCallbackTokenAsync({ isRest: true })来请求访问令牌 在我们的加载项启动期间.

We use the OfficeJs REST API for add-in development. To use this API, an accesstoken is needed, which we request by invoking Office.mailbox.getCallbackTokenAsync({ isRest: true }) during startup of our add-in.

对于onSend函数触发的任何代码,这都不会失败:似乎OfficeJs在触发onSend代码之前保存了邮件项.

This does not fail for any code triggered by the onSend function: It seems OfficeJs saves the mail item before onSend code is triggered.

但是,当邮件项尚未保存时,该请求显然失败了 (对于刚创建的任何新草稿都是这种情况),因此中断了在编写新消息后立即打开任务窗格时,加载项的初始化代码.

However, this request apparently does fail when the mail item is not yet saved - which is the case for any new draft when it is just created - and thus breaks the init code of our add-in when the task pane is opened straight after composing a new message.

为此,可以致电Office.messageCompose.saveAsync. 但是,这会导致任务窗格在刷新当前邮件项目(假设)时消失.

To remedy that, one can call Office.messageCompose.saveAsync. This however causes the task pane to disappear as the current mail item is refreshed (hypothesis).

我们是否可以做一些防止在调用saveAsync后关闭任务窗格或检索REST访问令牌而不必先保存邮件项的事情?

Is there anything that we can do to prevent the task pane from being closed after calling saveAsync or retrieve the REST access token without having to save the mail item first ?

推荐答案

为避免关闭任务窗格,请使用

To avoid the issue of the Task Pane closing, please use the new version of Outlook Web. The bug has been fixed in this version of Outlook.

这篇关于防止在保存过程中关闭任务窗格(异步)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆