locked
customUI tab does not appear RRS feed

  • السؤال

  • I have created a .dotm file with macros and inserted a relationship and customUI folder and .XML file. It loads without error when I open Word and the macros are in View Macros, but the tab and its buttons do not show up. I've been all over help+support but can't see what I have missed. I'm trying to do this for Word 2010 + 2013 but the latter is the most important.

    Here's the customUI.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <mso:customUI xmlns:mso="http://schemas.microsoft.com/office/2006/01/customui">
      <mso:ribbon>
        <mso:qat/>
        <mso:tabs>
          <mso:tab id="LevTech" label="LevTech" visible="true" >
            <mso:group id="IE" label="IXMLembedder" >
              <mso:button id="IE_InsertId" visible="true" size="large" 
                      label="Insert Document Id" keytip="I" 
                      screentip="insert a document id" 
                      onAction="IE_event_insert_doc_id" />
              <mso:button id="IE_InsertIndexes" visible="true" size="large" 
                      label="Insert Index" keytip="X" 
                      screentip="insert index(es)" 
                      onAction="IE_event_insert_indexes "/>
            </mso:group>
          </mso:tab>
        </mso:tabs>
      </mso:ribbon>
    </mso:customUI>

    Here's the .rel line:

    <Relationship Id="rId4" Type="http://schemas.microsoft.com/office/2006/relationships/
    ui/extensibility" Target="customUI/customUI.xml"/>


    David K. Ream

    14/محرم/1437 03:27 م

الإجابات

  • >>>It loads without error when I open Word and the macros are in View Macros, but the tab and its buttons do not show up.

    According to your description, I have made a sample to try to reproduce your issue, unfortunately, I can't.

    I suggest that you could make sure to add the following tag for your customUI content to the .rels file, making sure that it falls between the start and end tag for the group of <Relationships …>:

    <Relationship Id="rId4" 
    
    Type="http://schemas.microsoft.com/office/2006/relationships/
    
    ui/extensibility" Target="customUI/customUI.xml"/>
    

    and if the .rels file already contains a relationship tag with the ID rId4, use a different number. The ID needs to be unique.

    For more information, click here to refer about A Guide to Customizing the Office 2007 Ribbon

    15/محرم/1437 08:44 ص
  • >>>I compared the files I created and those by the editor but don't see any real substantive differences.

    I have used this customUI.xml that you created with namespace and succeeded to get the custom tab to display in 2013, you could see below:

    cusRibbon.JPG So I suggest that you could make sure to copy it back in, if you had to copy the .rels file out of the ZIP package to edit it.

    • تم الاقتراح كإجابة بواسطة David_JunFeng 24/محرم/1437 08:08 ص
    • تم وضع علامة كإجابة بواسطة Fei XueMicrosoft employee 26/محرم/1437 04:45 ص
    17/محرم/1437 09:13 ص

جميع الردود

  • Hi David

    I highly recommend using the Office 14 Custom UI Editor for incorporating a Ribbon into an Office file. Using it, you won't have to worry about creating the folder or the relationship. It's free and available here:
    http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2010/08/10/23248.aspx

    If you haven't already done so, activate "Show add-in user interface errors" in File/Options, the Advanced tab, General section. This will then display error information about your Ribbon XML (if present).

    Leave out the first line with the <xml> declaration.

    I can't recall having ever seen a prefix used for the customui namespace. Things will be much simpler (easier to read) if you omit that.

    The qat tag is not required and is only valid if you use startFromScratch so it's probably better if you leave it out.


    Cindy Meister, Office Developer/Word MVP, <a href="http://blogs.msmvps.com/wordmeister"> my blog</a>

    14/محرم/1437 04:03 م
  • Hello Dave,

    Do you get any UI errors in Word?

    See How to: Show Add-in User Interface Errors for more information.

    15/محرم/1437 08:26 ص
  • >>>It loads without error when I open Word and the macros are in View Macros, but the tab and its buttons do not show up.

    According to your description, I have made a sample to try to reproduce your issue, unfortunately, I can't.

    I suggest that you could make sure to add the following tag for your customUI content to the .rels file, making sure that it falls between the start and end tag for the group of <Relationships …>:

    <Relationship Id="rId4" 
    
    Type="http://schemas.microsoft.com/office/2006/relationships/
    
    ui/extensibility" Target="customUI/customUI.xml"/>
    

    and if the .rels file already contains a relationship tag with the ID rId4, use a different number. The ID needs to be unique.

    For more information, click here to refer about A Guide to Customizing the Office 2007 Ribbon

    15/محرم/1437 08:44 ص
  • I have tried it without the namespace as well as noted below. The .rels file is changed as required and as you noted above. I have turned on the UI errors but no errors display.

    <?xml version="1.0" encoding="utf-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
      <ribbon>
        <tabs>
          <tab id="LevTech" label="LevTech" visible="true" >
            <group id="IE" label="IXMLembedder" >
              <button id="IE_insert_doc_id" visible="true" size="large" 
                      label="Insert Document Id" keytip="I" 
                      screentip="insert a document id" 
                      onAction="IE_insert_doc_id_Click" />
              <button id="IE_insert_indexes" visible="true" size="large" 
                      label="Insert Index(es)" keytip="X" 
                      screentip="insert index(es)" 
                      onAction="IE_insert_indexes_Click" />
            </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>


    David K. Ream

    15/محرم/1437 11:33 ص
  • I "re-edited" the .dotm with the customUI Editor and validated the XML. Thanx that is a bit easier to use than doing things manually. But still no joy on getting the custom tab to display in 2013. The "add-in show errors" is checked but no errors display. 

    Very frustrating trying to get this to work for several days.


    David K. Ream

    15/محرم/1437 01:37 م
  • Here's my current customUI14.xml:

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">       <ribbon startFromScratch="false">
        <tabs>
          <tab id="LevTech" label="LevTech" visible="true" >
            <group id="IE" label="IXMLembedder" >
              <button id="IE_insert_doc_id" visible="true" size="large" 
                      label="Insert Document Id" keytip="I" 
                      screentip="insert a document id" 
                      onAction="IE_insert_doc_id_Click" />
              <button id="IE_insert_indexes" visible="true" size="large" 
                      label="Insert Index(es)" keytip="X" 
                      screentip="insert index(es)" 
                      onAction="IE_insert_indexes_Click" />
            </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>



    David K. Ream

    15/محرم/1437 01:38 م
  • I spoke too soon. It works.

    I compared the files I created and those by the editor but don't see any real substantive differences.

    Thanx!


    David K. Ream

    15/محرم/1437 01:43 م
  • Hi David

    My bet would be on the Relationship... Keep in mind that XML is case-sensitive, as well as the schema Office compares against when checking if something is valid. So even one mistype would "break" it...


    Cindy Meister, Office Developer/Word MVP, <a href="http://blogs.msmvps.com/wordmeister"> my blog</a>

    15/محرم/1437 06:20 م
  • >>>I compared the files I created and those by the editor but don't see any real substantive differences.

    I have used this customUI.xml that you created with namespace and succeeded to get the custom tab to display in 2013, you could see below:

    cusRibbon.JPG So I suggest that you could make sure to copy it back in, if you had to copy the .rels file out of the ZIP package to edit it.

    • تم الاقتراح كإجابة بواسطة David_JunFeng 24/محرم/1437 08:08 ص
    • تم وضع علامة كإجابة بواسطة Fei XueMicrosoft employee 26/محرم/1437 04:45 ص
    17/محرم/1437 09:13 ص
  • for mso 2010 and higher, the customui should be....

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    <ribbon>
    <tabs>
    <tab id="customTab" label="Contoso" insertAfterMso="TabHome">

                             ..... and so on

      - and  -

    <Relationship Type="http://schemas.microsoft.com/office/2007/relationships/ui/extensibility" Target="/customUI/customUI14.xml" Id="R131e66a518624244" />

    21/ذو القعدة/1441 02:37 م