Office.AddinCommands.EventCompletedOptions interface

Specifies the behavior of an on-send add-in, online-meeting provider add-in, or note-logging mobile add-in when it completes processing an event in Outlook.

Remarks

[ API set: Mailbox 1.8 ]

Minimum permission level: restricted

Applicable Outlook mode: Compose

Important: Although Outlook on Android and on iOS support up to Mailbox 1.5, the EventCompletedOptions object is supported in online-meeting provider and note-logging mobile add-ins. For more information on API support in Outlook on mobile devices, see Outlook JavaScript APIs supported in Outlook on mobile devices.

Properties

allowEvent

When you use the completed method to signal completion of an event handler, this value indicates if the handled event should continue execution or be canceled. For example, an on-send add-in that handles the ItemSend event can set allowEvent to false to cancel the sending of a message.

Property Details

allowEvent

When you use the completed method to signal completion of an event handler, this value indicates if the handled event should continue execution or be canceled. For example, an on-send add-in that handles the ItemSend event can set allowEvent to false to cancel the sending of a message.

allowEvent?: boolean;

Property Value

boolean

Remarks

[ API set: Mailbox 1.8 ]

Minimum permission level (Outlook): restricted

Applicable Outlook mode: Compose

Examples

// In this example, the checkMessage function was registered as an event handler for ItemSend.
function checkMessage(event) {
    // Get the item being sent.
    const outgoingMsg = Office.context.mailbox.item;

    // Check if subject contains "BLOCK".
    outgoingMsg.subject.getAsync(function (result) {
        // Subject is in `result.value`.
        // If search term "BLOCK" is found, don't send the message.
        const notFound = -1;
        const allowEvent = (result.value.indexOf('BLOCK') === notFound);
        event.completed({ allowEvent: allowEvent });
    });
}