Search code examples
c#outlookvstooutlook-addin

How to add custom ribbon button in Report tab of outlook


I want to add my custom ribbon button in the "Report" tab of Outlook. I am able to add a ribbon button in "Home" Tab of Outlook. Here I have attached the image where I want to add my custom ribbon button.

enter image description here

Thanks


Solution

  • Ribbon XML Code is here,

    <ribbon>
        <tabs>
          <tab idMso="TabReadMessage">
            <group id="grpMessageRibbon" Label="My Group">
              <button id="btnTest" Label="My Button" size="large" />
            </group>
          </tab>
        </tabs>    
      </ribbon>
    

    Ribbon XML load based on it's ribbon id.

      public string GetCustomUI(string ribbonID)
            {
                string ribbonXML = String.Empty;
    
                if (ribbonID == "Microsoft.Outlook.Report")
                {
                    ribbonXML = GetResourceText("MicrosoftOutlookReport.xml");
                }
    
                return ribbonXML;
            }
    

    Thanks