Office.AddinCommands.EventCompletedOptions interface

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

注解

API 集:邮箱 1.8

最低权限级别: 受限

适用的 Outlook 模式:Compose

重要说明:

使用方

属性

allowEvent

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

属性详细信息

allowEvent

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

allowEvent?: boolean;

属性值

boolean

注解

API 集:邮箱 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 });
    });
}