How to add a button to Outlook Standard toolbar
Here goes a quick code. You need to write your own button removal code
This uses VSTO - for Office 2007
private void ThisAddIn_Startup(object sender, System.EventArgs e) { Office.CommandBar cbar = Application.ActiveExplorer().CommandBars["Standard"]; Office.CommandBarButton btn = (Office.CommandBarButton)cbar.Controls.Add(Office.MsoControlType.msoControlButton, Type.Missing, Type.Missing, Type.Missing, true); btn.Click +=new Microsoft.Office.Core. _CommandBarButtonEvents_ClickEventHandler(btn_Click); } private void btn_Click(CommandBarButton Ctrl, ref bool CancelDefault) { MessageBox.Show("Clicked me!"); }
Related posts:























Leave a Reply
You must be logged in to post a comment.