vstooutlook-addinoutlook-2016

Disable the send button in Outlook


New to making an outlook addin. Is it possible to disable the Send button for a mail item? I have tried looping through controls and using the FindControl function to find the send button but cannot find it.

My latest attempt:

 Office.CommandBars commandBars = (Office.CommandBars)inspector.CommandBars;   
 Office.CommandBar standardToolbar = commandBars["Standard"];

 // Find the Send button 
 Office.CommandBarControl sendButton = standardToolbar.FindControl(
     Office.MsoControlType.msoControlButton, Type.Missing, "Send", true, true);

 // Disable the Send button
 sendButton.Enabled = false;

sendButton is always null though.


Solution

  • Send button is not on a ribbon, so you cannot replace or access in any way, but you can handle Application.ItemSend event and cancel the message submission.