Here goes a quick code. You need to write your own button removal code ;) This uses VSTO - for Office 2007

image

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)
Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati

Related posts:

  1. Checkbox - Check All, None
  2. Get list of WinForms Controls from an assembly
  3. Load user controls dynamically with ASP.NET
  4. Find your lucky number in c#
  5. Word Automation with .NET