问题
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