Search code examples
c#outlookvstoadd-inribbon

Outlook Add-in Menu Stay Open on Click


I am developing an add-in for Outlook (VSTO). This add-in features a new ribbon split button which contains a menu (configured via CustomUI XML). This menu contains multiple checkboxes. I want to be able to open this menu, click on multiple checkboxes, and then close the menu. Problem is that clicking any checkbox always closes the menu, which means I have to open the menu multiple times to check all required checkboxes. I want to be able to click these checkboxes and keep the menu open, until I click away or click on the menu button itself. Is this in any way possible? Image Link & Reduced XML Code below:

Outlook Add-in menu button

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <ribbon>
    <tabs>
      <tab idMso="TabNewMailMessage">
        <group id="Group" insertBeforeQ="GroupSend" autoScale="true" label="label">
          <splitButton id="SplitButton1" size="large" >
            <toggleButton id="toggleId"
              label="MyLabel"
              getImage="GetImage"
              onAction="myActionCallback"
              getPressed="getPressedCallback" />
            <menu id="MyMenu1" label="labelMenu" itemSize="normal" showLabel="true">
              <checkBox id="Checkbox1"
                    label="checkbox 1"
                    getPressed="Checkbox1GetPressedCallback"
                    onAction="myAction1" />
              <checkBox id="Checkbox2"
                    label="checkbox 2"
                    getPressed="Checkbox2GetPressedCallback"
                    onAction="myAction2" />
            </menu>
          </splitButton>
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

Solution

  • It sure sounds like the button click needs to show your owwn modal dialog with multiple checkboxes, not a dropdown menu.