none
How to hide / disable / capture click event of outlook mail send button ? RRS feed

  • Question

  • Is there an easy way to disable , hide and capture the event of click of outlook mail send button ? The solution has to be compatible with outlook 2007 and 2010 versions. Code examples will be appreciated.

    Thanks.
    Thursday, October 22, 2015 10:04 AM

Answers

  • Hello,

    You can handle the Send event of the MailItem class which is fired when the user selects the Send action for an item. Also you may find the ItemSend event of the Application class helpful. It is fired whenever an Microsoft Outlook item is sent, either by the user through an Inspector (before the inspector is closed, but after the user clicks the Send button) or when the Send method for an Outlook item, such as MailItem, is used in a program.

    To disable or hide the button you may consider using a form region which can override the whole inspector region leaving the ribbon control intact (the Replace-all region type). See Creating Outlook Form Regions for more information. Also you may consider using Advanced Outlook view and form regions.

    Thursday, October 22, 2015 10:20 AM
  • ItemSend allows to cancel the action. You just need to set the Cancel parameter to true. The Inspector wondow remains opened in that case.
    Thursday, October 22, 2015 10:45 AM

All replies

  • Hello,

    You can handle the Send event of the MailItem class which is fired when the user selects the Send action for an item. Also you may find the ItemSend event of the Application class helpful. It is fired whenever an Microsoft Outlook item is sent, either by the user through an Inspector (before the inspector is closed, but after the user clicks the Send button) or when the Send method for an Outlook item, such as MailItem, is used in a program.

    To disable or hide the button you may consider using a form region which can override the whole inspector region leaving the ribbon control intact (the Replace-all region type). See Creating Outlook Form Regions for more information. Also you may consider using Advanced Outlook view and form regions.

    Thursday, October 22, 2015 10:20 AM
  • If capturing click is possible, I'm looking for a way to capture the event and cancel it. So in this case, Send, Item send events will  not be helpful. And I was looking for a more programmatical way of doing it ? can we invalidate the particular send button and disable it conditionally ?

    Thursday, October 22, 2015 10:28 AM
  • ItemSend allows to cancel the action. You just need to set the Cancel parameter to true. The Inspector wondow remains opened in that case.
    Thursday, October 22, 2015 10:45 AM