Office.EventType enum
指定引发的事件的类型。 由 type 对象的 属性 *EventArgs 返回。
Project 的加载项支持 Office.EventType.ResourceSelectionChanged、 Office.EventType.TaskSelectionChanged和 Office.EventType.ViewSelectionChanged 事件类型。
只有 Outlook 的任务窗格加载项支持邮箱 API 设置事件类型。
注解
示例
// This sample shows how to register an event handler in Outlook.
Office.onReady(() => {
// Registers an event handler to identify when messages are selected.
Office.context.mailbox.addHandlerAsync(Office.EventType.SelectedItemsChanged, getMessageProperties, (asyncResult) => {
if (asyncResult.status === Office.AsyncResultStatus.Failed) {
console.log(asyncResult.error.message);
return;
}
console.log("Event handler added for the SelectedItemsChanged event.");
});
});
function getMessageProperties() {
// Retrieves the selected messages' properties and logs them to the console.
Office.context.mailbox.getSelectedItemsAsync((asyncResult) => {
if (asyncResult.status === Office.AsyncResultStatus.Failed) {
console.log(asyncResult.error.message);
return;
}
asyncResult.value.forEach((message) => {
console.log(`Item ID: ${message.itemId}`);
console.log(`Subject: ${message.subject}`);
console.log(`Item type: ${message.itemType}`);
console.log(`Item mode: ${message.itemMode}`);
});
});
}
字段
| ActiveViewChanged |
|
| AppointmentTimeChanged | 在 Outlook 中更改所选约会或系列的任何日期或时间时发生。 重要提示:只能在任务窗格中处理此事件。 函数命令无法为此事件注册处理程序。 若要为 |
| AttachmentsChanged | 在向项目添加或删除附件时发生。 重要提示:只能在任务窗格中处理此事件。 函数命令无法为此事件注册处理程序。 若要为 |
| BindingDataChanged | 在 Excel 或 Word 中更改绑定中的数据时发生。 若要为绑定的 BindingDataChanged 事件添加事件处理程序,请使用 Binding 对象的 addHandlerAsync 方法。 事件处理程序接收 类型为 Office.BindingDataChangedEventArgs 的参数。 |
| BindingSelectionChanged | 在 Excel 或 Word 的绑定中更改所选内容时发生。 若要为 |
| DialogEventReceived | 在对话框关闭或对话框导航失败时发生。 有关如何在外接程序中实现对话的指南,请参阅 在 Office 外接程序中使用 Office 对话 API。 |
| DialogMessageReceived | 当对话使用 有关如何在外接程序中实现对话的指南,请参阅 在 Office 外接程序中使用 Office 对话 API。 |
| DialogParentMessageReceived | 当主机页使用 有关如何在外接程序中实现对话的指南,请参阅 在 Office 外接程序中使用 Office 对话 API。 |
| DocumentSelectionChanged | 在 Excel 或 Word 中发生文档级选择时发生。 |
| DragAndDropEvent | 当 Outlook 客户端窗口中的邮件或文件附件被拖动到外接程序的任务窗格中时,在 Outlook 网页版 和新的 Outlook on Windows 中发生。 若要为
重要提示:Outlook [ API 集:邮箱 1.5 ] |
| EnhancedLocationsChanged | 在 Outlook 中更改约会位置时发生。 重要提示:只能在任务窗格中处理此事件。 函数命令无法为此事件注册处理程序。 若要为 |
| InfobarClicked | 在 Outlook 中使用定义的自定义作在通知邮件上选择 作时发生。 目前, “消除” 是唯一受支持的触发此事件的作。 若要为 重要说明:
|
| InitializationContextChanged | 当从 可作邮件、 InsightMessage 通知、 智能警报 对话框或 集成的垃圾邮件报告 对话框打开加载项的任务窗格时,在 Outlook 中发生。 如果加载项的任务窗格已在 Outlook 中打开,则此事件会阻止加载项重新启动。
重要说明: 若要为 |
| ItemChanged | 在固定任务窗格时选择其他 Outlook 项目进行查看时发生。 重要提示:只能在任务窗格中处理此事件。 函数命令无法为此事件注册处理程序。 若要为 [ API 集:邮箱 1.5 ] |
| NodeDeleted | 删除节点时 |
| NodeInserted | 在插入节点时 |
| NodeReplaced | 在替换节点时 |
| OfficeThemeChanged | 在 Outlook 中更改 OfficeTheme 时发生。 若要为 重要说明:
|
| RecipientsChanged | 在 Outlook 中更改所选项目的收件人列表或约会位置时发生。 重要提示:只能在任务窗格中处理此事件。 函数命令无法为此事件注册处理程序。 若要为 |
| RecurrenceChanged | 在 Outlook 中更改所选系列的重复模式时发生。 重要提示:只能在任务窗格中处理此事件。 函数命令无法为此事件注册处理程序。 若要为 |
| ResourceSelectionChanged | 在 Project 中发生资源选择时发生。 |
| SelectedItemsChanged | 选择或取消选择一个或多个邮件时,在 Outlook 中发生。 重要提示:只能在任务窗格中处理此事件。 函数命令无法为此事件注册处理程序。 若要为 |
| SensitivityLabelChanged | 当邮件或约会的敏感度标签发生更改时,在 Outlook 中发生。 重要提示:只能在任务窗格中处理此事件。 函数命令无法为此事件注册处理程序。 若要为 |
| SettingsChanged | 在 |
| SpamReporting | 在 Outlook 中报告未经请求的邮件时发生。 事件处理程序接收 类型为 Office.SpamReportingEventArgs 的参数。 |
| TaskSelectionChanged | 在 Project 中发生“任务”选择时发生。 |
| ViewSelectionChanged | 在 Project 中发生视图选择时发生。 |