Julian Mark Turner
Julian Mark Turner

Reputation: 1

Microsoft Office Ribbon Custom Tabs Corrupted If Hide Standard Tabs

I have created a set of custom tabs for the Microsoft Word Ribbon, which I load using tool in Word and appear in the AppData\Local\Microsoft\Office\Word.officeUI file.

They are proven to work, and the Word.officeUI file xml looks the same as my copy that I load.

However, recently I wanted to hide some standard tabs.

So I included: <mso:tab idMso="TabWordDesign" visible="false"/>

I then noticed my XML was being corrupted (some groups not appearing) when I closed Word, and on further investigation the Word.officeUI had changed (some of my XML vanished and all line breaks disappeared).

I could see it happening. I would load Word and import my customisation file, all looked fine in Word.officeUI, but when I closed, the Word.officeUI file changed to a fixed 18KB file (irrespective of the starting size) with just some of my xml.

I removed that xml, and the problem disappeared.

I then tried hiding the tab using the "Customise Ribbon" in Word instead.

The same problem occurred.

Essentially if I hide any standard tabs (however I do it), word corrupts my customUI when I close it.

Is this a bug I should report, or has anyone encountered and solved this problem?

Upvotes: 0

Views: 161

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49455

This is not a supported scenario. If you took a look at the articles posted later you might notice the following:

"It is not possible to override these commands from the custom UI XML markup or by using the object model... A better solution would be to consider hiding the built-in UI and rebuilding it fully with custom commands."

So, if you want to hide a built-in control or tab you need to use the startFromScratch mode (see the corresponding property in the ribbon markup) and rebuild the entire ribbon from the ground excluding the required controls.

Be aware, you can add built-in controls to your own tab where you can disable or hide them at runtime.

The Fluent UI (aka Ribbon UI) is described in depth in the following series of articles:

Upvotes: 0

Related Questions