Office.EventType enum
Specifies the kind of event that was raised. Returned by the type
property of an *EventArgs
object.
Add-ins for Project support the Office.EventType.ResourceSelectionChanged
, Office.EventType.TaskSelectionChanged
, and Office.EventType.ViewSelectionChanged
event types.
Only task pane add-ins for Outlook support Mailbox API set event types.
Remarks
Examples
// 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}`);
});
});
}
Fields
ActiveViewChanged | A |
AppointmentTimeChanged | Occurs when any date or time of the selected appointment or series is changed in Outlook. Important: This event can only be handled in a task pane. Function commands can't register a handler for this event. To add an event handler for the |
AttachmentsChanged | Occurs when an attachment is added to or removed from an item. Important: This event can only be handled in a task pane. Function commands can't register a handler for this event. To add an event handler for the |
BindingDataChanged | Occurs when data within the binding is changed in Excel or Word. To add an event handler for the |
BindingSelectionChanged | Occurs when the selection is changed within the binding in Excel or Word. To add an event handler for the |
DialogEventReceived | Triggers when Dialog has an event, such as dialog closed or dialog navigation failed. |
DialogMessageReceived | Triggers when a dialog sends a message via |
DialogParentMessageReceived | Triggers when a host page sends a message to a child dialog box with |
DocumentSelectionChanged | Triggers when a document-level selection happens in Excel or Word. |
EnhancedLocationsChanged | Occurs when the appointment location is changed in Outlook. Important: This event can only be handled in a task pane. Function commands can't register a handler for this event. To add an event handler for the |
InfobarClicked | Occurs in Outlook when an action is selected on a notification message with a defined custom action. Currently, "Dismiss" is the only supported action that fires this event. Important: This event can only be handled in a task pane. Function commands can't register a handler for this event. To add an event handler for the |
ItemChanged | Occurs when a different Outlook item is selected for viewing while the task pane is pinned. Important: This event can only be handled in a task pane. Function commands can't register a handler for this event. To add an event handler for the |
NodeDeleted | Triggers when a |
NodeInserted | Triggers when a |
NodeReplaced | Triggers when a |
OfficeThemeChanged | Occurs when the OfficeTheme is changed in Outlook. To add an event handler for the Important:
|
RecipientsChanged | Occurs when the recipient list of the selected item or the appointment location is changed in Outlook. Important: This event can only be handled in a task pane. Function commands can't register a handler for this event. To add an event handler for the |
RecurrenceChanged | Occurs when the recurrence pattern of the selected series is changed in Outlook. Important: This event can only be handled in a task pane. Function commands can't register a handler for this event. To add an event handler for the |
ResourceSelectionChanged | Triggers when a Resource selection happens in Project. |
SelectedItemsChanged | Occurs in Outlook when one or more messages are selected or deselected. Important: This event can only be handled in a task pane. Function commands can't register a handler for this event. To add an event handler for the |
SensitivityLabelChanged | Occurs in Outlook when the sensitivity label of a message or appointment changes. Important: This event can only be handled in a task pane. Function commands can't register a handler for this event. To add an event handler for the |
SettingsChanged | A |
SpamReporting | Occurs in Outlook when an unsolicited message is reported. The event handler receives an argument of type Office.SpamReportingEventArgs. |
TaskSelectionChanged | Triggers when a Task selection happens in Project. |
ViewSelectionChanged | Triggers when a View selection happens in Project. |
Office Add-ins