Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ribbon call back method implementaion in VSTO for outlook addin

i have to implement onbutton click activity in ribbon callback and i have this xml.

<button id="GoToAppConfiguration" size="large" label="Application Configuration" imageMso="AutoArchiveSettings" onAction="OnActionCallback"/>

and i am using function like this in ribbon call back :

public void OnActionCallback(Office.IRibbonControl control, bool isPressed)
    {
        if (control.Id == "GoToAppConfiguration")
        {
            MessageBox.Show("You clicked " + control.Id);
        }
        else
        {
            MessageBox.Show("You clicked a different control.");
        }
    }

but above code is not working ..

i think control is not going to that function it self..

please help ..

nikhil

like image 802
zytham Avatar asked Dec 12 '25 12:12

zytham


1 Answers

Your callback method signature doesn't match what the Ribbon XML is looking for. You need to omit the second parameter isPressed.

public void OnActionCallback(Office.IRibbonControl control)
{
    if (control.Id == "GoToAppConfiguration")
    {
        MessageBox.Show("You clicked " + control.Id);
    }
    else
    {
        MessageBox.Show("You clicked a different control.");
    }
}
like image 111
SliverNinja - MSFT Avatar answered Dec 14 '25 21:12

SliverNinja - MSFT