Office.MailboxEnums.SendModeOverride enum
Specifies the send mode option that overrides the option set in the manifest at runtime.
For information on how to implement a Smart Alerts add-in, see Handle OnMessageSend and OnAppointmentSend events in your Outlook add-in with Smart Alerts.
Remarks
Applicable Outlook mode: Compose
Examples
// 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 });
}
});
}
Fields
PromptUser = "promptUser" | Provides the Send Anyway option in a Smart Alerts dialog when the mail item doesn't meet the conditions of the event-based add-in. To learn more, see the prompt user send mode option. |
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
Office Add-ins