Office.InfobarDetails interface
提供有关引发 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;
}
}
属性
action |
操作类型。 目前,“消除”是唯一受支持的操作。 |
infobar |
通知类型。 |
属性详细信息
actionType
操作类型。 目前,“消除”是唯一受支持的操作。
actionType: MailboxEnums.InfobarActionType;
属性值
注解
infobarType
通知类型。
infobarType: MailboxEnums.InfobarType;