IE 11 Office.context.ui.displayDialogAsync错误12006

时间:2018-08-10 13:01:50

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

我想问为什么我出现错误12006(关闭对话框,通常是因为用户选择了X按钮。),尽管我没有关闭对话框。我在IE 11中收到此错误,但是一切都适用于chrome和Firefox。

这是我的代码:

private _addinDialog(): Promise<T> {
    return new Promise((resolve, reject) => {
        Office.context.ui.displayDialogAsync(this.url, {
            width: this.size.width$,
            height: this.size.height$
        }, (result: Office.AsyncResult) => {
            if (result.status === Office.AsyncResultStatus.Failed) {
                reject(result.error);
            }
            let dialog = result.value as Office.DialogHandler;
            // tslint:disable-next-line:no-any
            dialog.addEventHandler(Office.EventType.DialogMessageReceived, (args: any) => {
                let dlg = this._safeParse(args.message);
                resolve(dlg);
                dialog.close();
            });

            // tslint:disable-next-line:no-any
            dialog.addEventHandler(Office.EventType.DialogEventReceived, (args: any) => {
                reject(new DialogError(args.message, args.error));
                dialog.close();
            });
        });
    });
}

每次Office.context.ui.displayDialogAsync都在我的IE上运行,结果如下: IE 11 Office.context.ui.displayDialogAsync result

但是对于chrome,这是结果,并且可以在add中工作: Google Chrome Office.context.ui.displayDialogAsync result

感谢您的回答。

0 个答案:

没有答案