Both menus and toolbars are in fact CommandBar controls, and when you add child controls to a CommandBar you have the option to add the following type of controls:
- MsoControlType.msoControlActiveX
- MsoControlType.msoControlButton
- MsoControlType.msoControlComboBox
- MsoControlType.msoControlCustom
- MsoControlType.msoControlDropdown
- MsoControlType.msoControlEdit
- MsoControlType.msoControlPopup
For both toolbar buttons and menu items you add child controls of type MsoControlType.msoControlButton using the following code























When you have created a msoControlButton, you have the option of using one of the following styles
- MsoButtonStyle.msoButtonAutomatic
- MsoButtonStyle.msoButtonCaption
- MsoButtonStyle.msoButtonIcon
- MsoButtonStyle.msoButtonIconAndCaption
- MsoButtonStyle.msoButtonIconAndCaptionBelow
- MsoButtonStyle.msoButtonIconAndWrapCaption
- MsoButtonStyle.msoButtonIconAndWrapCaptionBelow
- MsoButtonStyle.msoButtonWrapCaption
Anything style with “Icon” its name, obviously supports having an icon displayed. Let’s pick the following as an example

There are three ways of adding an icon and the first one is using the FaceId property. This property allows you to specify an index for the icons that are built into Word and Excel and there is around 3000 of them.

The built in icons support transparency and are in fact the ones used by Word and Excel themselves. However, if the build in icons do not satisfy you, you can always create your own and use them instead. This brings us to the second way of adding icons which is using the PasteFace property. This property works in conjunction with the clipboard; you copy an icon into the clipboard and using PasteFace the button acquires the icon from the clipboard.












Unfortunately, this method does not support transparency, so if what you need is to add custom transparent icons, you need to go with option number three which uses STDOLE.
First you need to convert your image to IPictureDisp












Now you can set the button’s Picture and Mask property. You have to set the Picture property with the IPictureDisp version of the icon you would like to appear on the button and the Mask property with the IPictureDisp version of the icon’s mask. The icon’s mask is just another icon which has all of the transparent areas of the original icon filled with the white and the rest of the icon filled with black.
















来源: Extending Word with VSTO 2005 – Adding icons to toolbars and menus
其他有关链接:Adding Picture To Button On OutLook CommandBar