Share via


Office.MailboxEnums.SendModeOverride enum

実行時にマニフェストで設定されたオプションをオーバーライドする 送信モード オプションを指定します。

スマート アラート アドインを実装する方法については、「スマート アラートを使用して Outlook アドインで OnMessageSend イベントと OnAppointmentSend イベントを処理する」を参照してください。

注釈

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

適用できる Outlook モード: 新規作成

// The following example checks whether a location is specified in an appointment before it's sent.
function onAppointmentSendHandler(event) {
    Office.context.mailbox.item.location.getAsync({ asyncContext: event }, (asyncResult) => {
        const event = asyncResult.asyncContext;
        if (asyncResult.status === Office.AsyncResultStatus.Failed) {
            console.log(asyncResult.error.message);
            // If the add-in is unable to retrieve the appointment's location, the appointment isn't sent.
            event.completed({ allowEvent: false, errorMessage: "Failed to get the appointment's location." });
            return;
        }

        if (asyncResult.value === "") {
            // If no location is specified, the appointment isn't sent and the user is alerted to include a location.
            event.completed(
                {
                    allowEvent: false,
                    cancelLabel: "Add a location",
                    commandId: "msgComposeOpenPaneButton",
                    errorMessage: "Don't forget to add a meeting location.",
                    sendModeOverride: Office.MailboxEnums.SendModeOverride.PromptUser
                }
            );
        } else {
            // If a location is specified, the appointment is sent.
            event.completed({ allowEvent: true });
        }
    });
}

フィールド

PromptUser = "promptUser"

メール アイテムがイベント ベースのアドインの条件を満たしていない場合に、[スマート アラート] ダイアログで [Send Anyway]\( とにかく送信 \) オプションを提供します。 詳細については、プロンプト ユーザー送信モード オプションに関するページを参照してください。