How do I add an image icon for custom button in outlook
-
04-06-2021 - |
문제
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.
해결책
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
}
제휴하지 않습니다 StackOverflow