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.

Was it helpful?

Solution

You are not specifying getImage callback on the button XML element.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top