0
votes

I am developing an Outlook Addin (VSTO, C#). I created the Addin with the following steps in VS: New->Project , then

enter image description here

From all what I learned in the meantime I fear that this DOES NOT create a COM-AddIn. But all tutorials listed below refer to COM AddIns.

I am looking for a step by step tutorial of how I can disable the builtin OUtlook Button which converts an appointment into a recurring appointment. I already read a lot about fluent ribbons, like here

But I am just no able to put this into action for my purpose:

1.) I implemented in my Addin Class

public partial class ThisAddIn : Office.IRibbonExtensibility

...

 string Office.IRibbonExtensibility.GetCustomUI(string RibbonID)
        {

            throw new NotImplementedException();
        }

I set the breakpoint on the Exception. But running the addin (in Debugger) never stopped at that point. I tried what is mentioned here: IRibbonExtensibility GetCustomUI not called I added [ComVisible(true)] to the VSTO AddIn Class. Does not work either. I also made sure that the Addin is still loaded.

2.) I am not sure how I could that with Outlook. It says that Outlook has several xml files (one per inspector?)

3.) I am not sure whether I would be able to dynamically change the buttons. Athough the second tutorial talks about that, but i am not sure if callbacks are the right concept here, because my application activley wants to decide when a button should be active/inactive, so there is no waiting for a callback to happen?

I know that the links provided above contain step-by-step tutorials. But there are just too many open questions to these tutorials.

1

1 Answers

0
votes

You have already found a complete guide on how to repurpose a ribbon button. Just use command tag with the getEnabled attribute defined in your ribbon XML markup. For example:

 <?xml version="1.0" encoding="UTF-8"?>
 <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <commands>
    <command idMso="Permissions"  getEnabled="OnGetEnabled" />
  </commands>
 </customUI>

You can repurpose built-in ribbon controls, see Temporarily Repurpose Commands on the Office Fluent Ribbon for more information.

VSTO provides two ways of customizing the Fluent UI:

Unfortunately, the UI designer doesn't support all the features of the Fluent UI. So, you need to stick with a raw XML markup described in one of the articles mentioned above.