Page 1 of 1

Customized Ribbon

PostPosted: Tue Apr 02, 2019 11:57 pm
by Terry K
Hi there,

Sorry if the question has already been asked but I couldn't find a suitable answer to my problem.

Is there a way to add customUI part with docx4j ?

For now i managed to add a custom XML part which contains definition of a custom ribbon tab. But, it is not visible when i open the document. Besides adding relationship to the document does not change anything.

When doing it with Custom UI editor for Office, the xml added is stored in a folder called "customUI" not "customXml". That is the difference I've noticed. The customized ribbon is then visible when i open the document.

I really need to do it programmatically.

Thanks for your help.
Best regards

Re: Customized Ribbon

PostPosted: Mon Apr 08, 2019 6:29 pm
by jason
For the benefit of anybody else visiting this topic, https://gregmaxey.com/word_tip_pages/cu ... _main.html is useful background.

I guess you are talking about XML like:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon>
    <tabs>
      <tab idMso="TabView">
        <group idMso="GroupMacros" visible="false" />
      </tab>
    </tabs>
  </ribbon>
</customUI>
 
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


We don't currently have a Java object model for "http://schemas.microsoft.com/office/2006/01/customui" or "http://schemas.microsoft.com/office/2009/07/customui" or , but either or both would be easy enough to add.

Could you please attach a docx containing the xml part you'd like to be able to add/manipulate programmatically?