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!");
}
VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)