Office.AddinCommands.EventCompletedOptions interface

指定在 Outlook 中完成处理事件时 发送加载项、 联机会议提供程序加载项笔记日志记录移动加载项 的行为。

注解

[ API set: Mailbox 1.8 ]

最低权限级别受限

适用的 Outlook 模式:Compose

重要提示:尽管 Android 版和 iOS 版 Outlook 最多支持 Mailbox 1.5,EventCompletedOptions但联机会议提供程序和笔记记录移动加载项支持对象。有关移动设备上的 Outlook 中的 API 支持的详细信息,请参阅移动设备上的 Outlook 中支持的 Outlook JavaScript API

属性

allowEvent

使用 completed 方法 指示事件处理程序完成时,此值指示处理的事件应继续执行还是取消。 例如,处理 ItemSend 事件的 on-send 加载项可以设置为 allowEventfalse 以取消发送消息。

属性详细信息

allowEvent

使用 completed 方法 指示事件处理程序完成时,此值指示处理的事件应继续执行还是取消。 例如,处理 ItemSend 事件的 on-send 加载项可以设置为 allowEventfalse 以取消发送消息。

allowEvent: boolean;

属性值

boolean

注解

[ API set: Mailbox 1.8 ]

Outlook) 的最低权限级别 (受限

适用的 Outlook 模式:Compose

示例

// In this example, the checkMessage function was registered as an event handler for ItemSend.
function checkMessage(event) {
    // Get the item being sent.
    const outgoingMsg = Office.context.mailbox.item;

    // Check if subject contains "BLOCK".
    outgoingMsg.subject.getAsync(function (result) {
        // Subject is in `result.value`.
        // If search term "BLOCK" is found, don't send the message.
        const notFound = -1;
        const allowEvent = (result.value.indexOf('BLOCK') === notFound);
        event.completed({ allowEvent: allowEvent });
    });
}