Sari Se
Sari Se

Reputation: 23

How to listen an MailItem event in Mail Add-in?

I want to detect an event in Mail Add-in. In Outlook, thick/desktop version, we can detect the mail event, such as MailItem.Send and MailItem.AttachmentAdd.

Is it possible to listen to these events in Outlook online?

Upvotes: 2

Views: 655

Answers (2)

Mostafa
Mostafa

Reputation: 3302

nop. you can't do this. Office Apps can't interact with buttons or actions on the client apps such as: Outlook.

Upvotes: 0

Eric Legault
Eric Legault

Reputation: 5834

Unfortunately there are almost no events of any kind in the Mailbox API, other than asynchronous callbacks that are only fired when you initiate them. There is nothing that I'm aware of that can be used to detect item send or attachment modification events.

The closest option is to use the Outlook Notifications REST API (https://msdn.microsoft.com/office/office365/APi/notify-rest-operations), but these are more suitable to monitoring item/folder level changes. Perhaps you can hook into a notification for the Sent Items folder to approximate a MailItem.Send operation, or watch changes to a draft item to detect a newly added attachment.

Upvotes: 1

Related Questions