Hiding commandbar buttons in office addins

· Read in about 1 min · (115 words) ·

Have been pulling my hair out trying to make commandbar buttons go in VB Addins for Office 2000. There are a couple of gotchas here

  1. Any references to buttons that you’ve added are not valid by the time you get to the disconnection method. There’s a MSDN KB article on this and the workaround is to use FindControl to get a new reference to the button.

  2. The above technique works for Powerpoint and Excel. With ms word, the button is more stubborn. Turns out that it updates the normal template. So in a word addin, in addition to calling delete on the button, you should also save the normal template - see below..