none
Word Ribbon. Not doing what I expect RRS feed

  • Question

  • I am using the custom uai editor on Word 365 to create a new ribbon. I want to add the split cell option but cannot get it to work.

    <toggleButton idMso="SplitCell"/>

    Also tried

    <toggleButton idMso="SplitCell" showLabel="false"/>

    The item does not appear on the ribbon. Where am I going wrong?


    Neville Turbit


    Wednesday, April 4, 2018 12:38 PM

Answers

  • In the earlier (Word 2007) namespace, it's a "toggleButton". In the newer namespace, it's a "control".

    so, e.g. the following should show the control:

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
      <ribbon startFromScratch="false">
        <tabs>
          <tab id="mytab" label="My Tab" insertBeforeMso="TabHome">
            <group id="mygroup" label="My Group">
              <control idQ="SplitCells"/>
            </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>
    
    

    The icon should be greyed until you click inside a table.

    Something I found quite useful when working with this stuff was to go into Word->File->Options->Customize Ribbon, create a custom tab, copy groups/buttons etc. in there, then use the Import/Export button near the bottom right to export the customizations and look at the XML that Word exports.


    Peter Jamieson

    • Marked as answer by Neville T Thursday, April 5, 2018 12:25 PM
    Thursday, April 5, 2018 7:57 AM

All replies

  • At the very least, you probably need "SplitCells" not "SplitCell"

    Peter Jamieson

    Wednesday, April 4, 2018 1:17 PM
  • You are right Peter. I changed it to SplitCells but it still does not appear in the ribbon. Could it be something to do with being in a table? Thinking of the table layout tab not appearing until the cursor is in a table.

    Neville Turbit

    Thursday, April 5, 2018 12:39 AM
  • In the earlier (Word 2007) namespace, it's a "toggleButton". In the newer namespace, it's a "control".

    so, e.g. the following should show the control:

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
      <ribbon startFromScratch="false">
        <tabs>
          <tab id="mytab" label="My Tab" insertBeforeMso="TabHome">
            <group id="mygroup" label="My Group">
              <control idQ="SplitCells"/>
            </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>
    
    

    The icon should be greyed until you click inside a table.

    Something I found quite useful when working with this stuff was to go into Word->File->Options->Customize Ribbon, create a custom tab, copy groups/buttons etc. in there, then use the Import/Export button near the bottom right to export the customizations and look at the XML that Word exports.


    Peter Jamieson

    • Marked as answer by Neville T Thursday, April 5, 2018 12:25 PM
    Thursday, April 5, 2018 7:57 AM
  • Hi Neville,

    It seems that you are using some VBA codes for creating new ribbon in Word. To get more help, I would move the thread to Word for developers forum for more suggestion. Thanks for your understanding.


    Best Regards,
    Winnie Liang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Thursday, April 5, 2018 8:58 AM
  • Hi Guys. Thanks for all the help. Got it working using the line:

     <control idQ="SplitCells"/>

    The ribbon is primarily VBA macros but incorporated a few relevant controls into the ribbon for convenience. This one had me lost until Peter was able to help. Thanks so much <g class="gr_ gr_325 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" data-gr-id="325" id="325">Peter</g>.


    Neville Turbit

    Thursday, April 5, 2018 12:25 PM