0

I have a bare bones VSTO Outlook Add-in. I've added an empty Ribbon via this article and it works.

The Ribbon.cs and the Ribbon.xml files currently reside in my project's root but if I move them to a sub folder (say AddIn\Ribbon) there are no compile errors but when I run Outlook the addin's ribbon is missing. Playing around with it, it appears that the Ribbon.xml must stay in my project's root for the ribbon to appear.

I don't understand this behavior; is there a setting or something that manually references the addin's ribbon location?

Thanks!

E.Beach
  • 1,829
  • 2
  • 22
  • 34

1 Answers1

0

I figured it out after a fresh look: After adding a new Ribbon (XML) item, there is a generated function GetCustomUI that uses the path to XML file as the look-up key in the assembly's resources for the file.

So when moving a file, you should change the call to GetResourceText from something like this:

   return GetResourceText("MyAddin.Ribbon.xml");

to something like this:

   return GetResourceText("MyAddin.Ribbons.Ribbon.xml");

You need this because the xml file is linked as a resource in the project file which should have a line like this:

  <EmbeddedResource Include="Ribbons\Ribbon.xml" />
E.Beach
  • 1,829
  • 2
  • 22
  • 34