Office.MailboxEvent interface
该 MailboxEvent 对象作为参数传递到加载项的事件处理程序,该加载项实现 基于事件的激活,包括 智能警报、 集成垃圾邮件报告功能或 解密。 它允许加载项向 Outlook 客户端表明它已完成处理事件。
注解
最低权限级别: 受限
适用的 Outlook 模式:Compose 或 Read
重要说明:
邮箱 1.14 中引入了对集成垃圾邮件报告功能的支持。
邮箱 1.16 中引入了对解密功能的支持。
有关 函数命令按钮、 发送时加载项、 联机会议提供程序加载项和 笔记记录移动加载项使用的事件对象的信息,请参阅 Office.AddinCommands.Event。
方法
| completed(options) | 指示基于事件的垃圾邮件报告加载项或解密加载项已完成事件处理。 |
方法详细信息
completed(options)
指示基于事件的垃圾邮件报告加载项或解密加载项已完成事件处理。
completed(options?: SmartAlertsEventCompletedOptions | SpamReportingEventCompletedOptions | MessageDecryptEventCompletedOptions): void;
参数
- options
-
Office.SmartAlertsEventCompletedOptions | Office.SpamReportingEventCompletedOptions | Office.MessageDecryptEventCompletedOptions
可选。 指定在处理完事件时基于事件的垃圾邮件报告或解密加载项的行为的对象。
返回
void
注解
最低权限级别: 受限
适用的 Outlook 模式:Compose 或 Read
重要说明:
邮箱 1.14 中引入了对集成垃圾邮件报告功能的支持。
邮箱 1.12 中引入了对向参数分配
SmartAlertsEventCompletedOptionsoptions对象的支持。邮箱 1.16 中引入了对解密功能的支持。
示例
// The following example sets the subject when a new message is composed.
function onNewMessageComposeHandler(event) {
const subject = "Set by an event-based add-in!";
Office.context.mailbox.item.subject.setAsync(
subject,
{
asyncContext: event,
},
(asyncResult) => {
const event = asyncResult.asyncContext;
if (asyncResult.status === Office.AsyncResultStatus.Failed) {
console.error("Failed to set subject: " + asyncResult.error.message);
event.completed();
return;
}
// Signal to the Outlook client that the event has been processed.
console.log("Successfully set the subject.");
event.completed();
}
);
}