Attachment events

A

Alexander Galkin

How can I be notified in my Outlook COM Add-in when any e-mail that has an
attachment is being opened and when an attachment is being added to new
outgoing e-mail? There are AttachmentAdd ant AttachmentRead events in
MailItem object. However, I do not know if these events are fired for every
mail being opened that has an attachment and when attachment is being
attached to outgoing mail. I also don't know how can I get this object from
Application object as this is the only object I initially get in Add-in.
 
K

Ken Slovak - [MVP - Outlook]

You need to get the MailItem that is opened, usually in the NewInspector
event and the MailItem has to be declared WithEvents. Then you can handle
AttachmentAdd for the Attachments collection of that item.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top