Using custom icons for buttons in Outlook
If you worked with Outlook before you know that there is a FaceID property in CommandBarButton class. FaceID property is a number which represents a specific builtin icon in Outlook 2003. (Here are all built in icons).
But if you're doing something more serious and the icons that are in Outlook don't satisfy your needs you'll need to create and use custom made icons for your buttons.
So, here it is: how can you use your own icon?
It's really, really simple - just use PasteFace () method in CommandBarButton class.
Before calling this method you'll need to load your image from resources, clear the clipboard, copy it to the clipboard and finally paste it to your button. Here's a snippet how to do it:
// First: clear the clipboard
Clipboard.Clear ();
// Read the bitmap from resources
Bitmap bmp = <Namespace>.Properties.Resources.<ResourceName>
// Copy image to clipboard
Clipboard.SetImage (bmp);
// Create your button
...
// Set the custom icon
button1.PasteFace();
And that's it - you have your own icon on your buttons in Outlook 2003.
UPDATE:
Helmut Obertanner emailed me with a better solution for setting and icon to buttons. Problem in approach that I selected was that the clipboard is emptied (Clipboard.Clear()) whenever the CommandBar is created (on Outlook startup) and thus you loose all the data in the clipboard.
On his site you can find a sample which uses the picture and mask properties. Check if out here.