Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add an image icon for custom button in outlook

I have a custom button in outlook and I have to add image icon for the same button.

Ribbon XML is:

<button id="GoToAppConfiguration" 
    label="Application Configuration" 
    getImage="GetCustomImage" 
    onAction="GoToAppConfigurationClicked" 
    size="normal" />

I want to write ribbon callback method but how do I write the same and how do I use an image stored in a Resource folder under the Addin project.

like image 287
zytham Avatar asked Apr 27 '12 11:04

zytham


1 Answers

You just need to return a Bitmap from GetCustomImage. Here is a c# example, assuming you have added the BMP to your Project Resources.

public Bitmap GetCustomImage(Office.IRibbonControl control)
{
    return Properties.Resources.btnAppConfiguration_Image; // resource Bitmap
}
like image 181
SliverNinja - MSFT Avatar answered Oct 23 '22 14:10

SliverNinja - MSFT