0

My situation is similar to this one, but neither of the answers there worked for me.

In a brand-new project with no code, I have a very simple ribbon button:

enter image description here

...but Outlook (latest version, M365) will no longer display it. I say "no longer" because at first it did. I then removed it manually by Customizing the Ribbon and removing the custom group from the right-hand list:

enter image description here

Apparently, however, I should have removed it via the File\Options\Add-ins dialog, as it now won't display at all, no matter what I do. Oddly, the stock Add-ins\Get Add-ins combo flickers ever so slightly when I F5 run the project with Visual Studio (2022).

The more common solutions don't work. Web searches turn up answers to every problem but this one. ChatGPT is AWOL, presumably out trying to catch Rosie the Robot.

How do I get my button (and group) to show up again?

--EDIT--

I have since discovered that the ribbon does at least attempt to load when I start a new email message (but only the first time after I restart Outlook).

After turning on Show VSTO Add-in user interface errors in the Advanced options, I get this:

enter image description here

I tried renaming the tab in the designer to TabMail, but that didn't bring any improvement.

Here're the Properties for the RibbonTab:

enter image description here

...and here're my selected RibbonTypes:

enter image description here enter image description here

Out of sheer curiosity I turned on the StartFromScratch property, and my button does display without error under that configuration:

enter image description here

I can also start a new email (using Ctrl+N) without the previous error message.

Here's the XML from my ribbon export:

<?xml version="1.0" encoding="UTF-8"?>
<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon>
    <tabs>
      <tab idMso="TabAddIns">
        <group id="Group1" label="Group1">
          <button id="Button1" label="Click Me" showImage="false" />
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

After wiring up the Override in the new Ribbon.vb, there's no improvement in the overall situation when I use an XML ribbon vs. the ribbon designer.

Is my Outlook setup broken somehow? It sure feels like it.

InteXX
  • 6,135
  • 6
  • 43
  • 80

1 Answers1

2

First, try to unregister and then register the add-in back by running the Clean command of your add-in project and then Build to register it back.

By default, if a VSTO Add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom ribbon does not appear, or why a ribbon appears but no controls appear. For Outlook, the Show VSTO Add-in user interface errors checkbox is located in the Developer section of the details pane.

There are two ways of creating a custom ribbon UI with VSTO:

  1. Walkthrough: Create a custom tab by using the Ribbon Designer
  2. Walkthrough: Create a custom tab by using Ribbon XML

Second, if you use the ribbon designer you need to check whether the Add-ins tab is visible on the ribbon or not. So, you may try to place your controls to the custom tab. Just click on the right hand side of your ribbon tab on the designer surface to add a custom tab. Also you may try to change ribbon controls IDs.

The last resort is to export your custom ribbon UI to the ribbon XML and troubleshoot the UI using callbacks. See How to: Export a ribbon from the Ribbon Designer to Ribbon XML for more information.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • Thanks for having a look. I've edited my question to include the additional troubleshooting steps that you've advised. Alas, still no improvement. – InteXX Mar 08 '23 at 18:43
  • What's the difference between removing an Add-in via the `File\Options\Add-ins` dialog and removing it by right-clicking the ribbon and choosing `Customize the Ribbon`? Did I send my setup sideways by opting for the latter by mistake? – InteXX Mar 08 '23 at 18:45
  • In case of ribbon only the custom UI is removed, but the add-in continue its work. – Eugene Astafiev Mar 08 '23 at 19:07
  • Well, duh. I've been looking for my custom control on the `Home` tab. As I recall, you specifically asked me whether I had an `Add-ins` tab, and I said _no_. Wish I hadn't, 'cause I do. So my control is displaying and functioning correctly. Thank you. – InteXX Mar 08 '23 at 19:13
  • _"the add-in continue its work"_ Yes, I just discovered that by starting a new email (and reproducing the error), and then right-clicking to customize the ribbon. There was an empty Add-ins group there, so I removed it. I restarted Outlook, started a new email, and the error was gone. – InteXX Mar 08 '23 at 19:15
  • Observation: this thing sure is quirky. – InteXX Mar 08 '23 at 19:16