简体   繁体   English

如何在Outlook中为自定义按钮添加图像图标

[英]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. 我在Outlook中有一个自定义按钮,我必须为同一个按钮添加图像图标。

Ribbon XML is: 功能区XML是:

<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. 我想编写功能区回调方法但是如何编写相同的内容以及如何使用存储在Addin项目下的Resource文件夹中的图像。

You just need to return a Bitmap from GetCustomImage . 您只需要从GetCustomImage返回一个Bitmap Here is ac# example, assuming you have added the BMP to your Project Resources . 这是ac#示例,假设您已将BMP添加到项目资源中

public Bitmap GetCustomImage(Office.IRibbonControl control)
{
    return Properties.Resources.btnAppConfiguration_Image; // resource Bitmap
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM