Share via


Office.MailboxEvent interface

オブジェクトはMailboxEventスマート アラートなど、イベント ベースのアクティブ化を実装するアドインのイベント ハンドラーに引数として渡されます。 これにより、アドインは、イベントの処理が完了したことを Outlook クライアントに示すことができます。

注釈

[ API セット: メールボックス 1.10 ]

最小アクセス許可レベル: 制限

適用できる Outlook モード: 新規作成または読み取り

メソッド

completed(options)

イベント ベースのアドインがイベントの処理を完了したことを示します。

メソッドの詳細

completed(options)

イベント ベースのアドインがイベントの処理を完了したことを示します。

completed(options?: SmartAlertsEventCompletedOptions): void;

パラメーター

options
Office.SmartAlertsEventCompletedOptions

オプション。 イベントの処理が完了したときのイベント ベースのアドインの動作を指定する オブジェクト。

戻り値

void

注釈

[ API セット: メールボックス 1.10 ]

最小アクセス許可レベル: 制限

適用できる Outlook モード: 新規作成または読み取り

// The following example sets the subject when a new message is composed.
function onNewMessageComposeHandler(event) {
    const subject = "Set by an event-based add-in!";
    Office.context.mailbox.item.subject.setAsync(
        subject,
        {
            asyncContext: event,
        },
        (asyncResult) => {
            const event = asyncResult.asyncContext;
            if (asyncResult.status === Office.AsyncResultStatus.Failed) {
                console.error("Failed to set subject: " + asyncResult.error.message);
                event.completed();
                return;
            }

            // Signal to the Outlook client that the event has been processed.
            console.log("Successfully set the subject.");
            event.completed();
        }
    );
}