locked
ribbon confused RRS feed

  • Question

  • I have two templates to which I have added ribbon tabs. The customization is stored in the templates.

    They work fine by themselves, but when I have both loaded, Word seems confused. Clicking a button does not activate that button, but another button on the ribbon. 

    Is there some limitation here?

    Is there a way to have both tabs from two separate templates work at the same time?

    Saturday, July 10, 2010 4:38 PM

Answers

  • I've solved this problem. In the two different templates, I had two subs with the same name that handled the callbacks. Changing the name of one of them fixed it.
    • Proposed as answer by mcramer Friday, July 23, 2010 12:38 AM
    • Marked as answer by Sally Tang Monday, July 26, 2010 4:37 AM
    Friday, July 23, 2010 12:38 AM

All replies

  • What version of Word are we talking about?  is the 2010's ribbon edition capablility or 2007 XML custom ribbon modification?
    If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Cheers, Shane Devenshire
    Saturday, July 10, 2010 5:37 PM
  • Word 2010, but I've customized the XML in each template. (Not using the built in customization method.)
    Saturday, July 10, 2010 7:02 PM
  • I've done a little more testing and have discovered the following.

    In Word 2010, if you have a customized ribbon stored in a template and you load that template as a global template (in Word's startup directory) then you create a document from a second template that also has a customized ribbon, the ribbon controls don't work.

    The second template seems to wipe out the customUI from the first (global) template.

    This seems to be a bug in Word 2010.

    Wednesday, July 14, 2010 6:37 PM
  • I created 2 templates in Word 2010.

    Then added a customui to both templates.

    In each customUI I added a single new tab with a group and a button.

    Then assigned macro via a callback in each template.

    I added one template to the Word Startup Folder thus becomes a Global Template and the other template I used as a document template.

    I created a new document based on this template. Word launched and both tabs with visible in Ribbon and both macros worked.

    Based on this I'm not seeing a problem with how Word 2010 handles multiple templates with customized ribbons.

    Please post the xml for both templates?

     

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Harold Kless Microsoft Online Community Support
    Wednesday, July 14, 2010 9:16 PM
  • Thanks for your help.

    Here's the XML from the two I tried:

    First template:

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="OnRibbonLoad" loadImage="LoadImages">
      <ribbon startFromScratch="false">
        <tabs>
          <tab id="tab0" label="Testingxml Tab" getVisible ="GetVisible">
            <group id="grp0" autoScale="false" centerVertically="false" label="Group 0" getVisible ="GetVisible">
              <button id="btn_0" size="large" label="Button 0" imageMso="_3DBevelPictureTopGallery" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
              <button id="btn_1" size="large" label="Button 1" imageMso="_3DEffectColorPickerClassic" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
            </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>

    Second Template:

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="OnRibbonLoad" loadImage="LoadImages">
      <ribbon startFromScratch="false">
        <tabs>
          <tab id="tab0" label="Testing XML2" getVisible ="GetVisible">
            <group id="grp0" autoScale="false" centerVertically="false" label="Group 0" getVisible ="GetVisible">
              <button id="btn0T2" size="large" label="Button 0" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
              <button id="btn1T2" size="large" label="Button 1" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
            </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>

    Wednesday, July 14, 2010 11:31 PM
  • Hi Mark,

    I've reviewed your xml for the 2 ribbons and I'm not certain why you are using the same values for both ribbons.

    Your question falls into the paid support category which requires a more in-depth level of support.  Please visit the below link to see the various paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

     

     

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Harold Kless Microsoft Online Community Support
    Monday, July 19, 2010 10:11 PM
  • I've solved this problem. In the two different templates, I had two subs with the same name that handled the callbacks. Changing the name of one of them fixed it.
    • Proposed as answer by mcramer Friday, July 23, 2010 12:38 AM
    • Marked as answer by Sally Tang Monday, July 26, 2010 4:37 AM
    Friday, July 23, 2010 12:38 AM