none
Add-In sending MeetingItem RRS feed

  • Question

  • Hello, I have a problem, i can not solve.

    I have an Add-In, which works with attachments when sending a mail in Outlook.

    I have added methods:

    this.Application.ItemSend += Application_ItemSend;

    _outboxItems.ItemAdd += OutboxItems_ItemAdd;

    After i add these EventHandlers a cannot send Meeting request, it gets stuck in Outbox.

    I can recognize the MeetingItem by this command:

    if (Item is MSOutlook.MeetingItem)

    but Item.Send() does not work and

    Item.GetAssociatedAppointment(false).Send() just clones the meeting request in outbox.

    If i do nothing, it gets stuck also, like there are not another EventHandlers.

    Thanks for reply.

    Tuesday, June 7, 2016 4:04 PM

Answers

  • Do not use Itemns.ItemAdd event on the Outbox folder - as soon as you touch with the Outlook Object Model an item marked for submission, the submission process is cancelled.

    Use Application.ItemSend - it fires before the item is actually submitted and will not interfere with the submission process.

     

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by RadekHlavacek Wednesday, June 8, 2016 7:21 AM
    Wednesday, June 8, 2016 4:19 AM

All replies

  • Hello Radek,

    What code exactly do you have in the ItemSend event handler?

    Anyway, you shouldn't call the Send method anew in the ItemSend event handler. Instead, you just need to let the event handler finish its job and the item will be sent successfully. If you need to stop the item from sending you can set the Cancel parameter to true. In that case the send action will not be completed and the inspector will be left opened.


    [custom.development]

    Tuesday, June 7, 2016 6:32 PM
  • Do not use Itemns.ItemAdd event on the Outbox folder - as soon as you touch with the Outlook Object Model an item marked for submission, the submission process is cancelled.

    Use Application.ItemSend - it fires before the item is actually submitted and will not interfere with the submission process.

     

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by RadekHlavacek Wednesday, June 8, 2016 7:21 AM
    Wednesday, June 8, 2016 4:19 AM