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

add-in, c#, outlook, ribbon-control

Solution

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
}

Problem

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.

Original source