none
How to repurpose send button in compose window RRS feed

  • Question

  • HI All,

    I am writing my VSTO plugin for outlook 2013 for windows 7. I would like to repurpose send button as we want to do some long processing on click of send button. As outlook blocks its UI until mail doesn't move to outbox, we can not perform this on send event directly. Therefore, we want to repurpose the control, so that we can handle out job asynchronously in other thread and close the dialog box.

    I have try couple of things to repurpose "Send" button :-- 

    <command idMso="SendDefault" onAction="OnAction_Button_Send" />

    I have also tried "SendItem", "GroupSend".

    Can someone please suggest right idmso for send button, so that we can get control in OnAction_Button_Send, on click of send button.

    Thanks

    Devendra

    Wednesday, March 28, 2018 11:22 AM

Answers

  • Cancel the submission from the Application.ItemSend event. If you want to close the inspector, start a timer in  ItemSend, then close it when the timer fires (you cannot do that from the ItemSend event handler).

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

    Wednesday, March 28, 2018 3:44 PM
  • It's been a while since I've looked at this, but if I remember correctly the Send button in the Inspector window when composing a new mail message is not part of the ribbon.
    Wednesday, March 28, 2018 11:31 AM

All replies

  • It's been a while since I've looked at this, but if I remember correctly the Send button in the Inspector window when composing a new mail message is not part of the ribbon.
    Wednesday, March 28, 2018 11:31 AM
  • Ohh.. that means I will have only one option i.e. handle ItemSend event ?

    Thanks

    Dev

    Wednesday, March 28, 2018 11:59 AM
  • Ohh.. that means I will have only one option i.e. handle ItemSend event ?

    Thanks

    Dev


    What's the problem with using the Outlook event to start a separate thread for your task so that it doesn't block the Outlook main thread?
    Wednesday, March 28, 2018 12:38 PM
  • Cancel the submission from the Application.ItemSend event. If you want to close the inspector, start a timer in  ItemSend, then close it when the timer fires (you cannot do that from the ItemSend event handler).

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

    Wednesday, March 28, 2018 3:44 PM
  • Hello Devendra Tewari,

    What's the state of the thread? Have you tried to handle ItemSent event? Could it work for you?

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 29, 2018 5:40 AM
  • Since the question of whether or not the Send button can be repurposed has been answered, it's not clear to me what other question is being asked here.
    Thursday, March 29, 2018 11:21 AM
  • Hi RLWA32,

    My apology for late response. Yes... It is answered by RLWA32 and Dmitry. Thanks for help.

    Thanks

    Dev

    Saturday, March 31, 2018 3:16 PM