Consulting

Results 1 to 5 of 5

Thread: More than one Customui

  1. #1
    VBAX Newbie
    Joined
    Jul 2010
    Posts
    5
    Location

    More than one Customui

    I have two Word 2010 templates, each of which adds a tab to the ribbon. They work fine separately, but when both are loaded, they don't work. One interferes with the other. Pressing a button on one runs code from the other template.

    I've verified that the control ids do not duplicate each other and the macros they callback have different names.

    Is there any way to have two customui files in place at the same time? Or alternatively, is there a way to disable the current customui and run the second one?

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    I've had 2 2007 documents loaded without conflicts.

    Can you load documents from each of the templates, or post the XML?

    The first thing is to see if you're assuming the wrong document is active, and your code runs on ActiveDocument which might be the Other Document

    Paul

  3. #3
    VBAX Newbie
    Joined
    Jul 2010
    Posts
    5
    Location
    I've done a little more testing and I've discovered the following. The problem arises when one of the two templates with a customized ribbon is loaded as a global template (in Word's startup directory.)

    The global template ribbon works fine, until a document is created from the second template. At that point, clicking on a button on a custom tab in the global template's ribbon produces the same result as clicking on the button in the second template's customized ribbon.

    You can try this with the two attached templates.

    They work fine on their own. This seems to be a bug in Word 2010.
    Last edited by mcramer; 07-14-2010 at 11:33 AM.

  4. #4
    VBAX Newbie
    Joined
    Jul 2010
    Posts
    5
    Location
    I've solved this issue. In the two different templates that loaded the different tabs, I had a sub with the same name (that handled the button clicks.) Changing the name of one of them fixed it.

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •