Error while executing async get of Outlook item property

梦想的初衷 提交于 2019-12-22 01:10:14

问题


Why am I getting Could not complete the operation due to error 80043200 sometimes while getting Outlook item property (for example, Subject) in email Compose mode?

Call stack:

Error
   at n.prototype.execute (appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.02.js:11:86635)
   at u.DDA.OutlookAppOm.prototype.callOutlookDispatcher (appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.02.js:11:150300)
   at u.DDA.OutlookAppOm.prototype.invokeHostMethod (appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.02.js:11:150169)
   at u.DDA.OutlookAppOm.prototype._standardInvokeHostMethod$i$0 (appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.02.js:11:148443)
   at r.ComposeSubject.prototype.getAsync (appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.02.js:11:190544)

We use following code for getting a field from an Outlook item:

sfMailApp.OfficeManager.prototype._reloadField = function (name, defaultValue) {
var deferred = $.Deferred();
defaultValue = defaultValue || '';

var item = this.getItem();

if (item.isFake) {
    deferred.resolve('');
    return deferred.promise();
}

var field = item[name];
if (field && this._isComposeMode && field.getAsync) {
    var _this = this;
    try {
        field.getAsync(function (result) {
            if (result.status === Office.AsyncResultStatus.Succeeded) {
                _this[name] = _this._processOfficeData(result.value) || defaultValue;
                deferred.resolve(_this[name]);
            }
            else {
                _this._onError(result);
                deferred.reject();
            }
        });
    } catch (e) {
        deferred.reject();
    }
} else {
    this[name] = this._processOfficeData(field) || defaultValue;
    deferred.resolve(this[name]);
}

return deferred.promise();}

Code for getItem function:

sfMailApp.OfficeManager.prototype.getItem = function () {
var item = Office && Office.context && Office.context.mailbox && Office.context.mailbox.item ? Office.context.mailbox.item : null;

if (!item) {
    item = {
        isFake: true
    }
}

return item;}

One more error we're getting sometimes while trying to get user identity token:

{"name":"AccessRestricted","message":"Internal protocol error: -2147467259'.","code":9017 }

How should we handle that?

来源:https://stackoverflow.com/questions/45918823/error-while-executing-async-get-of-outlook-item-property

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