jblack
jblack

Reputation: 576

Word 365 2016 - Add custom button to Home tab

I am trying to add a custom button to the home tab in MS Word (365/2016) but having no luck. Nothing happens, no custom button appears. My XML as below:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon>
    <tabs>
      <tab idMso="TabHome">
        <group id="CustomGroup1" label="my Group" insertAfterIdMso="GroupEditing">
          <button id="Button1" label="insert custom footnote" size="large" imageMso="FootnoteInsert" onAction="RibbonControl.myMacro"/>
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

Any assistance would be appreciated.

Thanks

Upvotes: 0

Views: 557

Answers (1)

Timothy Rylatt
Timothy Rylatt

Reputation: 7860

Your CustomUI xml has an error, so it will not load. Word will silently block the xml unless you turn on the option to show errors.

  • In Word go to File | Options | Advanced | General and ensure that "Show add-in user interface errors" is checked.

The line with the error:

<group id="CustomGroup1" label="my Group" insertAfterIdMso="GroupEditing">

insertAfterIdMso is invalid. It should be insertAfterMso, making the corrected line:

<group id="CustomGroup1" label="my Group" insertAfterMso="GroupEditing">

You can avoid errors in your xml by using a tool such as the Office RibbonX Editor which will enable you to validate the xml.

Upvotes: 2

Related Questions