Office.context.roamingSettings.saveAsync函数在将Dialog API用于Office加载项时给出错误

时间:2018-08-20 06:53:53

标签: outlook-addin office-js office-addins

保存漫游设置值时出现以下错误。此Office.initialize方法是在对话框窗口(myDialog.html)中定义的,并且使用 Office.context.ui.displayDialogAsync('https://myAddinDomain/myDialog.html');

enter image description here

Office.initialize = function (reason) {
            $(document).ready(function () {
                //console.log("Sending auth complete message through dialog: " + oauthResult.authStatus);
                Office.context.roamingSettings.set("o365auth", 'yyryy');         
                Office.context.roamingSettings.saveAsync(function (asyncResult) {
                    if (asyncResult.status === "success") {
                        var dataValue = result.value; // Get selected data.


                    } else {
                        var err = result.error;

                    }
                });

            });
        }

错误说“ 未捕获的TypeError:无法读取null的属性“ invoke”     在window.OSF.DDA.OutlookAppOm.u.DDA.OutlookAppOm.invokeHostMethod

enter image description here

1 个答案:

答案 0 :(得分:0)

当前,我们仅在对话框内支持Office.context.ui.messageParent API。