Office.AddinCommands.EventCompletedOptions interface
注解
最低权限级别: 受限
适用的 Outlook 模式:Compose
重要说明:
尽管 Android 和 iOS 上的 Outlook 最高支持邮箱 1.5,但联机会议提供程序和笔记记录移动加载项支持该
EventCompletedOptions对象。有关移动设备上的 Outlook 中的 API 支持的详细信息,请参阅移动设备上的 Outlook 支持的 Outlook JavaScript API。基于事件的激活 和 集成垃圾邮件报告 加载项使用不同的事件对象在它们完成事件处理时发出信号。 有关详细信息,请参阅 Office.MailboxEvent。
使用方
属性
| allow |
使用 completed 方法 发出事件处理程序完成的信号时,此值指示已处理的事件是应继续执行还是取消。 例如,处理 |
属性详细信息
allowEvent
使用 completed 方法 发出事件处理程序完成的信号时,此值指示已处理的事件是应继续执行还是取消。 例如,处理 ItemSend 事件的发送时加载项可以设置为 allowEventfalse 取消消息的发送。
allowEvent?: boolean;
属性值
boolean
注解
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 });
});
}