0
votes

I have an Outlook Addin, doing some code (with attachments) when the user saves an appointment, using Item_Change event.

When I open the Outlook , the Calendar is automatically updated- so Item_Change event fires.

Without debugging, I can see the new attachments in apoointments after the auto update.

In Debug, On Item_Change event appointment.Attachments do not contain the new files.

  • Can I cause appointment.Attachments to be updated?

  • How can I know if Item_Change event fires after auto updtae or because the appointment was saved by the user?

1

1 Answers

0
votes

Can I cause appointment.Attachments to be updated?

You may call the Save method.

How can I know if Item_Change event fires after auto updtae or because the appointment was saved by the user?

The ribbon UI controls can be repurposed so, you will know that users initiated the action. See Temporarily Repurpose Commands on the Office Fluent Ribbon for more information. Note, you need to override keybord shortcuts too in that case. Read more about that in the Using shortcut keys to call a function in an Office Add-in article.

You may also consider handling the AttachmentAdd event of Outlook items which is fired when an attachment has been added to an item. Or the BeforeAttachmentAdd event which is fired before an attachment is added and allows to cancel the action.