You are not specifying getImage callback on the button XML element.
Change a Image in ribbon button_click event for outlook ribbon button control using c#?
-
09-10-2022 - |
Question
i done to create a custom tab and ribbon button in outlook addin using Ribbon(XML) in C#.
i want to change the ribbon button image when i click the button.how to i acheive that?
here my XML Design:
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load" loadImage="GetCustomImage">
<ribbon>
<tabs>
<tab id="TabAddIns" label="Mail Security">
<group id="Group2" >
<button id="Encrypt" onAction="Encrypt_Click" label="Encrypt" size="large" image="email-security.png" getVisible="Control_Visible" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
GetCustomImage Function:
public stdole.IPictureDisp GetCustomImage(string imageName)
{
return PictureConverter.ImageToPictureDisp(Properties.Resources.email_security);
}
Actually i want to change the "Encrypt" Button image(email-security.png) into another one when after click that button.i have already try to call the GetCustomImage() in Encrypt button click.but its not working.
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow