Office.context.mailbox.addHandlerAsync fails when reload the frame

别来无恙 提交于 2019-12-08 10:56:02

问题


I am implementing the pinnable taskpane in my outlook web add-in This is my code:

Office.initialize = function (reason) {
    $(document).ready(function () {
        // Listen to ItemChanged event
        Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged, itemChanged, function (result) {
            console.log(result)
            if (result.status === Office.AsyncResultStatus.Failed) {
                // here will be hit if I do a postback in the server, could also be replicated by choosing "reload frame" in the right click menu
             {name: "Internal Error", message: "An internal error has occurred.", code: 5001}
            }
        });
        gatherMailItemInfo();
    });
}

Everything works fine( gatherMailItemInfo get calls when I switching between items. But as long as a do a post to the server ( can simply replicated by choosing "reload frame" in the right click menu) the handler will fail.

I am using office 365 for testing. Windows desktop client has no such issues.

来源:https://stackoverflow.com/questions/52033374/office-context-mailbox-addhandlerasync-fails-when-reload-the-frame

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!