简体   繁体   English

如何在邮件插件中侦听 MailItem 事件?

[英]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.在 Outlook 厚版/桌面版中,我们可以检测邮件事件,例如MailItem.SendMailItem.AttachmentAdd.

Is it possible to listen to these events in Outlook online?是否可以在 Outlook Online 中收听这些事件?

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.不幸的是,邮箱 API 中几乎没有任何类型的事件,除了仅在您启动它们时触发的异步回调。 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.最接近的选项是使用 Outlook 通知 REST API ( https://msdn.microsoft.com/office/office365/APi/notify-rest-operations ),但这些更适合监控项目/文件夹级别的更改。 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.也许您可以挂钩已发送邮件文件夹的通知以近似 MailItem.Send 操作,或者观察草稿项目的更改以检测新添加的附件。

nop.不。 you can't do this.你不能这样做。 Office Apps can't interact with buttons or actions on the client apps such as: Outlook. Office 应用程序无法与客户端应用程序上的按钮或操作交互,例如:Outlook。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM