ADXOutlookItemEvents.ProcessAttachmentRemove

Add-in Express™ Support Service
That's what is more important than anything else

ADXOutlookItemEvents.ProcessAttachmentRemove
 
Sebastien Lange




Posts: 34
Joined: 2022-09-21
Hi,

When I right click on an attachment in a new email, then click Remove, ADXOutlookItemEvents.ProcessAttachmentRemove is fired.

But if I select the attachment, then press Delete key, ProcessAttachmentRemove is not fired!

Am I doing something wrong? How can I be informed through the second way as well?

Best regards,
S?bastien
Posted 15 Mar, 2023 06:20:40 Top
Andrei Smolin


Add-in Express team


Posts: 18791
Joined: 2006-05-11
Hello S?bastien,

That's Outlook who actually raises events while Add-in Express sort of wraps them so that you get ProcessAttachmentRemove called. If it isn't called, there was no event. I confirm, this in is the case in pure VBA: the MailItem.AttachmentRemove event (see https://learn.microsoft.com/en-us/office/vba/api/Outlook.MailItem.AttachmentRemove) isn't raised if you delete using {Delete}.

You can handle the deletion by periodically checking the mail item. If your business logic allows this scenario, this would be the simplest way out.

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Mar, 2023 10:58:15 Top
Andrei Smolin


Add-in Express team


Posts: 18791
Joined: 2006-05-11
Hello S?bastien,

In my tests, deleting an attachment by pressing {Delete}, raises the AttachmentSelectionChanged event on an Inspector object (I haven't tested doing this in an Explorer window). In that event you can check the attachments selected during the previous AttachmentSelectionChanged event. What do you think?

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 16 Mar, 2023 06:12:57 Top
Sebastien Lange




Posts: 34
Joined: 2022-09-21
Thanks Andrei! It's indead a good start.
Posted 17 Mar, 2023 07:00:58 Top