Temporary CommandBar Customizations in Word
September 4th, 2007It’s common for an Office add-in to put some custom menu items or toolbar buttons in the UI of the hosting application. The method to call to do this is CommandBars.Add. It is also typical that you’d like those customizations to appear so long as the add-in gets loaded, but not appear if it doesn’t. If your add-in gets uninstalled, for example, you clearly don’t want left-over customizations littering the application. For this reason, the Add method’s final parameter is a boolean that indicates whether a particular added control should be added temporarily. The documentation describes the parameter like this:
- Temporary
- Optional Object. True to make the new control temporary. Temporary controls are automatically deleted when the container application is closed. The default value is False.
This looks perfect. You can add the customizations at startup, and they’ll be gone at shutdown… except that it doesn’t work in Word.
Read the rest of this entry »