0
votes

I am developing a Word-Addin using VSTO which is compatible with Word 2013 and later versions.

I have the Ribbon.xml and the Ribbon.cs files and I have implemented the Word-addin label in title case. I am only having one Ribbon.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load" >
  <ribbon>
    <tabs>
      <tab id ="Ribbon1" label="Test"  >
        <group id="Document" getLabel="Document"  imageMso="ControlsGallery">
        <!-- Some content here -->
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

The final product of my project is an .exe file, where we can install the Word-Addin (inner operations done within a set of dll files) in the customer machine.

When Word has its default ribbons' labels in upper case, how should we modify the Ribbon.xml to show the ribbon name in upper case ('TEST') along with other word ribbons. Currently mine is displaying like below (captured from Word 2013).

enter image description here

Also how should we identify what is the case used in the Word default ribbon bar titles.

I have searched the web, but found no supporting article. Please help me with this.

Thank you in advance.

1
For which version(s) of Word is the VSTO Add-in designed? From which version of Word is the screen shot?Cindy Meister
@CindyMeister Add-in is designed for Word 2013 and later versions. The screenshot is of Word 2013. I have made changes to the question to have this details now.ApsSanj

1 Answers

0
votes

I have found an answer.

Created another set of Ribbon.cs and Ribbon.xml to hold the Uppercase ribbon code, and now I have the below classes and xml files set.

  • RibbonTitleCase.cs
  • RibbonTitleCase.xml
  • RibbonUpperCase.cs
  • RibbonUpperCase.xml

Added the below code within ThisAddin.CreateRibbonExtensibilityObject method

protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
{
    FieldInfo temp = this.ItemProvider.GetType().GetField("_officeVersion", BindingFlags.NonPublic | BindingFlags.Instance);
    uint officeVersion = (uint)temp.GetValue(this.ItemProvider);

    if (officeVersion == 15)
    {
        return new RibbonUpperCase();
    }
    else
    {
        return new RibbonTitleCase();
    }
}

Tried to use one Ribbon.cs class and with two Ribbon.xml files, but it didn't succeeded.