0
votes

Using this Outlook 2013, I develop an addin in C#. My ribbon.xml looks like:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <contextMenus>
    <!-- Move mail to -->
    <contextMenu idMso="ContextMenuMailItem">
      <button id="MoveMailTo_CM"
              imageMso="CopyToFolder"
              insertBeforeMso="Copy"
              getLabel="MoveMailTo_GetLabel"
              getVisible="MoveMailTo_GetVisible"
              onAction="MoveMailTo_OnAction"/>
    </contextMenu>
    <!-- Manage holiday request -->
    <contextMenu idMso="ContextMenuMailItem">
      <button id="ManageHolidayRequest_CM"
              imageMso="CopyToPersonalCalendar"
              insertBeforeMso="Copy"
              label="Copy to Calendar"
              getVisible="ManageHolidayRequest_GetVisible"
              onAction="ManageHolidayRequest_OnAction" />
    </contextMenu>
  </contextMenus>
</customUI>

When I launch my addin using Visual Studio and I right-click on an email item, only the first "getVisible" is called (the MoveMailTo_GetVisible) but not the other one.

If i switch both menu, only ManageHolidayRequest_GetVisible is called.

Can't we specify two different function in that case? Any workaround ?

Best regards,

1
You have buttons and only one button function is called at a time. You can create a third button and put both set of instructions in a new button. You can crate a macro and put the code into a macro since it is automatically being called when starting without pushing the button. - jdweng

1 Answers

1
votes

Answer was : I had two <contextMenu idMso="ContextMenuMailItem"> (so for the same Mso). Just merged both button in context Menu and worked.