Office.DialogOptions interface

ダイアログの表示方法のオプションを提供します。

プロパティ

asyncContext

コールバックに渡される AsyncResult オブジェクトの asyncContext プロパティで、変更せずに返される任意の型のユーザー定義項目。

displayInIframe

ダイアログ ボックスを IFrame 内に表示する必要があるかどうかを指定します。この設定は Office Online クライアントでのみ適用できます。 この設定はOffice on the webでのみ適用でき、他のプラットフォームでは無視されます。 false (既定値) の場合、ダイアログは新しいブラウザー ウィンドウ (ポップアップ) として表示されます。 IFrame に表示できない認証ページに推奨されます。 true の場合、ダイアログは IFrame を含むフローティング オーバーレイとして表示されます。 これは、ユーザー エクスペリエンスとパフォーマンスに最適です。

height

現在の表示のパーセンテージとして、ダイアログの高さを定義します。 既定は 80%。 最小 250 px。

promptBeforeOpen

ポップアップ ブロック ダイアログをユーザーに表示するかどうかを決定します。 既定は true です。

true - ナビゲーションをトリガーし、ブラウザーのポップアップ ブロックを回避するためのポップアップがフレームワークに表示されます。 false - ダイアログは表示されず、(ナビゲーションをトリガーするユーザー インターフェイス アーティファクトを提供することにより) 開発者はポップアップを処理する必要があります。

width

現在の表示のパーセンテージとして、ダイアログの幅を定義します。 既定は 80%。 最小 150 px。

プロパティの詳細

asyncContext

コールバックに渡される AsyncResult オブジェクトの asyncContext プロパティで、変更せずに返される任意の型のユーザー定義項目。

asyncContext?: any

プロパティ値

any

displayInIframe

ダイアログ ボックスを IFrame 内に表示する必要があるかどうかを指定します。この設定は Office Online クライアントでのみ適用できます。 この設定はOffice on the webでのみ適用でき、他のプラットフォームでは無視されます。 false (既定値) の場合、ダイアログは新しいブラウザー ウィンドウ (ポップアップ) として表示されます。 IFrame に表示できない認証ページに推奨されます。 true の場合、ダイアログは IFrame を含むフローティング オーバーレイとして表示されます。 これは、ユーザー エクスペリエンスとパフォーマンスに最適です。

displayInIframe?: boolean

プロパティ値

boolean

height

現在の表示のパーセンテージとして、ダイアログの高さを定義します。 既定は 80%。 最小 250 px。

height?: number,

プロパティ値

number

// The following example shows how to open a dialog with a specified size. It also shows
// how to register a function to handle the message when Office.UI.messageParent() is called
// in the dialog and how to use that handler to close the dialog. The implementation of the processMessage() function is omitted.

Office.context.ui.displayDialogAsync("https://www.contoso.com/myDialog.html", { height: 30, width: 20 },
    (asyncResult) => {
        const dialog = asyncResult.value;
        dialog.addEventHandler(Office.EventType.DialogMessageReceived, (arg) => {
            dialog.close();
            processMessage(arg);
        });
    }
);

// The following example does the same thing in TypeScript.

Office.context.ui.displayDialogAsync("https://www.contoso.com/myDialog.html", { height: 30, width: 20 },
    (asyncResult: Office.AsyncResult) => {
        const dialog: Office.Dialog = asyncResult.value;
        dialog.addEventHandler(Office.EventType.DialogMessageReceived, (arg: string) => {
            dialog.close();
            processMessage(arg);
        });
    }
);

promptBeforeOpen

ポップアップ ブロック ダイアログをユーザーに表示するかどうかを決定します。 既定は true です。

true - ナビゲーションをトリガーし、ブラウザーのポップアップ ブロックを回避するためのポップアップがフレームワークに表示されます。 false - ダイアログは表示されず、(ナビゲーションをトリガーするユーザー インターフェイス アーティファクトを提供することにより) 開発者はポップアップを処理する必要があります。

promptBeforeOpen?: boolean;

プロパティ値

boolean

width

現在の表示のパーセンテージとして、ダイアログの幅を定義します。 既定は 80%。 最小 150 px。

width?: number,

プロパティ値

number

// The following example shows how to open a dialog with a specified size. It also shows
// how to register a function to handle the message when Office.UI.messageParent() is called
// in the dialog and how to use that handler to close the dialog. The implementation of the processMessage() function is omitted.

Office.context.ui.displayDialogAsync("https://www.contoso.com/myDialog.html", { height: 30, width: 20 },
    (asyncResult) => {
        const dialog = asyncResult.value;
        dialog.addEventHandler(Office.EventType.DialogMessageReceived, (arg) => {
            dialog.close();
            processMessage(arg);
        });
    }
);

// The following example does the same thing in TypeScript.

Office.context.ui.displayDialogAsync("https://www.contoso.com/myDialog.html", { height: 30, width: 20 },
    (asyncResult: Office.AsyncResult) => {
        const dialog: Office.Dialog = asyncResult.value;
        dialog.addEventHandler(Office.EventType.DialogMessageReceived, (arg: string) => {
            dialog.close();
            processMessage(arg);
        });
    }
);