OfficeRuntime.Dialog interface

表示对话框的对象。

注解

API 集:CustomFunctionsRuntime 1.1

使用方

示例

const dialogUrl = "https://your-addin-domain.com/dialog.html";
const dialogOptions: OfficeRuntime.DisplayWebDialogOptions = {
  height: "50%",
  width: "50%",
  displayInIFrame: false,
  onMessage: function (message: string, dialog?: OfficeRuntime.Dialog) {
    dialog?.close();
    console.log("Dialog result: " + message);
  },
  onRuntimeError: function (error: Error, dialog?: OfficeRuntime.Dialog) {
    dialog?.close();
    console.log("Dialog error: " + error.message);
  },
}
OfficeRuntime.displayWebDialog(dialogUrl, dialogOptions);

方法

close()

关闭对话框的方法。 返回承诺。

方法详细信息

close()

关闭对话框的方法。 返回承诺。

close(): Promise<void>;

返回

Promise<void>

注解

API 集:CustomFunctionsRuntime 1.1