In my Outlook Addin I subscribed to AttachmentRemove
and AttachmentAdd
of MailItem
.
The Add Event fires while the Remove event is not fired in Outlook 2016. Outlook 2013 Both works. Both events are subscribed and unsubscribed the same time and the same way. I'm pretty sure no object is collected that would prevent raising the event.
edit (Version info)
Office Versions:
- Microsoft Outlook 2016 MSO (16.0.13801.20240) 32-bit 2102 (Build 13801.20294 Click-to-Run)
- Microsoft Outlook 2016 (16.0.5113.1000) MSO (13.0.5122.1000) 32-Bit
Both systems where office is installed are 64bit systems.
edit (code snipped)
public CommonItemInternal(object item)
{
if (item == null)
return;
this.UniqueId = GetUniqueId(item);
commonItemLookup.Add(this.UniqueId, this);
this.Item = item;
if (this.Item is MailItem)
{
var mailItem = this.Item as MailItem;
mailItem.PropertyChange += this.COM_CommonItemInternal_PropertyChange;
mailItem.AttachmentRemove += this.COM_mailItem_AttachmentRemove; // <-- Does not get called
mailItem.AttachmentAdd += this.COM_mailItem_AttachmentAdd; // <-- Get called
}
}