Add custom icon to commandbar button

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top