Add custom icon to commandbar button

  • Thread starter Thread starter Dhananjay
  • Start date Start date
D

Dhananjay

Hi all,
My outlook addin is developed in VSTO using VB 2005 for office 2007.
How can I add icon to my custom commandbar button? I checked on MS
site & found one reference to this part, but my icon is shown with
blue background.

Thanks,
Dhananjay
 
For buttons that aren't in WordMail Inspectors you can use separate image
files for the Picture and Mask properties of a button. For managed code you
can use AxHost for passing the IPictureDisp objects for the image files.
Make sure you follow the guidelines for image resolution and color depth.

That won't work for WordMail Inspectors. Mask and Picture take IPictureDisp
objects and those cannot be passed across process boundaries. For those you
need to look at the old KB article on creating a masked image on the
Clipboard using a color pixel at coordinate 0,0 as your mask color.
Essentially you create a mask DIB on the fly and overlay on the image DIB.
After your image is on the Clipboard you use the PasteFace method to put the
image on the button.
 
Back
Top