Office.Dialog interface

The object that is returned when UI.displayDialogAsync is called. It exposes methods for registering event handlers and closing the dialog.

Methods

addEventHandler(eventType, handler)

Registers an event handler. The two supported events are:

  • DialogMessageReceived. Triggered when the dialog box sends a message to its parent.

  • DialogEventReceived. Triggered when the dialog box has been closed or otherwise unloaded.

close()

Called from a parent page to close the corresponding dialog box.

sendMessage(name)

FOR INTERNAL USE ONLY. DO NOT CALL IN YOUR CODE.

Method Details

addEventHandler(eventType, handler)

Registers an event handler. The two supported events are:

  • DialogMessageReceived. Triggered when the dialog box sends a message to its parent.

  • DialogEventReceived. Triggered when the dialog box has been closed or otherwise unloaded.

addEventHandler(eventType: Office.EventType, handler: Function): void;

Parameters

eventType
Office.EventType
handler
Function

Returns

void

close()

Called from a parent page to close the corresponding dialog box.

close(): void;

Returns

void

sendMessage(name)

FOR INTERNAL USE ONLY. DO NOT CALL IN YOUR CODE.

sendMessage(name: string): void;

Parameters

name
string

Returns

void