I do not have Outlook, but I used the following in Word / Excel / PPT, so I hope that it will work in Outlook (unverified!).
Try adding a Ribbon element (XML), and then add two tabs with a button that looks the same and calls the same code, but with different identifiers.
XML:
<tab idMso="TabNewMailMessage">
<group id="MyGroup1" label="My Group1">
<button id="myButton1" label="Button 1" size="large" onAction="ButtonOnAction" />
</group>
</tab>
<tab idMso="TabAppointment">
<group id="MyGroup2" label="My Group2">
<button id="myButton2" label="Button 2" size="large" onAction="ButtonOnAction" />
</group>
</tab>
WITH#:
public void ButtonOnAction(IRibbonControl control)
{
switch (control.Id)
{
case "myButton1":
case "myButton2":
Console.Out.WriteLine("Button ID: {0}", control.Id);
break;
}
}
source
share