Office.MailboxEnums.InfobarType enum
Office.EventType.InfobarClicked 允许的通知类型。
注解
示例
/*
* This snippet activates when a notification message is dismissed from an Outlook message or appointment.
* The event handler logs the custom action and notification type to the console.
*/
Office.context.mailbox.item.addHandlerAsync(Office.EventType.InfobarClicked, eventHandler, callback);
function eventHandler(event) {
const infobarDetails = event.infobarDetails;
// Log the custom action type.
console.log(`Custom action type: ${infobarDetails.actionType}`);
// Log the notification type.
switch (infobarDetails.infobarType) {
case Office.MailboxEnums.InfobarType.Error:
console.log("Notification type: Error message");
break;
case Office.MailboxEnums.InfobarType.Informational:
console.log("Notification type: Informational message");
break;
case Office.MailboxEnums.InfobarType.Insight:
console.log("Notification type: Informational message with available actions from the task pane");
break;
case Office.MailboxEnums.InfobarType.ProgressIndicator:
console.log("Notification type: Progress indicator");
break;
}
}
字段
Informational = 0 | 通知显示信息性消息。 |
ProgressIndicator = 1 | 通知显示进度指示器。 |
Error = 2 | 通知显示错误消息。 |
Insight = 3 | 通知显示包含操作的信息性消息。 |