Search code examples
xmloutlook-addinribbon

How to use build-in outlook group inside customized ribbon tab


I'm crating a tab for an outlook add-in, and I need to implement build-in group element of outlook's ribbon.

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <ribbon>
    <tabs>
      <tab idMso="TabMail">
        <button id ="myButtonId" screentip="myTab"/>
      </tab>
      <tab id="myTabId" insertAfterMso="TabMail">
        <group idMso="GroupMailNew"/>

        <!-- some addional elements -->

      </tab>
    </tabs>
  </ribbon>
</customUI>

As you may see I'm trying to call the Outlook's group for new Emails/Items with the GroupMailNew id, but it returns:

enter image description here

It suppose to be like:

enter image description here

(Without the small horizontal New Email button)

As I see there is probably two option to solve it:

  1. Use different idMso.
  2. Try to find the New Email element edit and set its visible attribute to false.

Any help?


Solution

  • You need to include built-in controls into your custom group, not to add a built-in group with all controls:

    <?xml version="1.0" encoding="UTF-8"?>
     <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <ribbon>
       <tabs>
        <tab idMso="TabMail">
          <button id ="myButtonId" screentip="myTab"/>
        </tab>
        <tab id="myTabId" insertAfterMso="TabMail">
         <group id="your_id_here">
           <!-- built-in controls with idMso specified go there -->
         </group/>
        </tab>
       </tabs>
      </ribbon>
    </customUI>
    

    Read more about the Fluent UI in the following series of articles: