none
Customizing the ribbon in Word 2010 RRS feed

  • Question

  • I am customizing my Word 2010 Ribbon with CustomUI.

    When inserting a built-in gallery into a custom group within a custom tab, I cannot figure out how to display Word's built-in 'QuickStylesGallery' as a single row within the ribbon and not as a drop-down menu.

    Code used to insert the Gallery ...

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
       <ribbon>
        <tabs>
    <!-- A custom tab which will include various custom groups with custom controls. -->
          <tab id="MyTab" label="My tab" insertAfterMso="TabHome">
    <!-- A custom group which will include various custom controls and also, for convenience, an existing built-in gallery. -->
       <group id="ExistingStyles" label="Existing Quick Styles">
      <gallery idMso="QuickStylesGallery"/>
       </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>

    What I want to do can be achieved manually from within Word by using 'Customize the Ribbon' and creating a custom tab and group, adding QuickStylesGallery to the custom group, right-clicking Quick Styles (QuickStylesGallery) and unchecking the Minimize Gallery option in the context menu.

    I've come up against a brick wall trying to find the correct attribute for the gallery element and I've got a horrible feeling that I can't see the 'wood for the trees' and that the solution is embarrassingly simple; any help or tips will be very much appreciated.

    Monday, January 3, 2011 1:05 PM

Answers

  • Hi Ghillie

    <<Could the size of the group containing the gallery/control be a restraining factor on how the gallery/control is displayed?>>

    Yes, the available width in the application window will definitely determine how a gallery is displayed. You can see this if you "restore" the Window size as an end-user, then move the right or left-hand side with the mouse.

    Although it's not said that this is actually the problem :-)

    If you'd use the entire built-in group, rather than just the control, you'd probably get the Gallery (assuming there's enough space to display it as a gallery).


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Ghillie Tuesday, January 4, 2011 7:46 PM
    Tuesday, January 4, 2011 4:36 PM
    Moderator

All replies

  • Hi Ghillie

    See this message thread, the one marked as the Answer:

    http://social.msdn.microsoft.com/Forums/en/worddev/thread/204c610a-a179-4c86-9a12-2ad677edb184

    Try substituting "control" for "gallery" in the element:

    <control idMso="QuickStylesGallery" />


    Cindy Meister, VSTO/Word MVP
    Monday, January 3, 2011 10:22 PM
    Moderator
  • Many thanks for your reply Cindy.

    Changing "gallery" to "control" didn't work for me, I'm afraid.

    I'm going to try a callback next and experiment with a solution using VBA.

    If I don't succeed with this, it won't be the end of the world but it would still be nice to find a solution.

    Could the size of the group containing the gallery/control be a restraining factor on how the gallery/control is displayed?

    Ghillie.

    Tuesday, January 4, 2011 10:37 AM
  • Hi Ghillie

    <<Could the size of the group containing the gallery/control be a restraining factor on how the gallery/control is displayed?>>

    Yes, the available width in the application window will definitely determine how a gallery is displayed. You can see this if you "restore" the Window size as an end-user, then move the right or left-hand side with the mouse.

    Although it's not said that this is actually the problem :-)

    If you'd use the entire built-in group, rather than just the control, you'd probably get the Gallery (assuming there's enough space to display it as a gallery).


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Ghillie Tuesday, January 4, 2011 7:46 PM
    Tuesday, January 4, 2011 4:36 PM
    Moderator
  • Cindy,

    Your suggestion to use the whole group was a good one. Maybe the attribute that I required for the built-in control has not been made accessible? Changed my code to ...

    <group idMso="GroupStyles"></group>
    

    Many thanks, Ghillie.

    Tuesday, January 4, 2011 7:53 PM