0
votes

I've been crashing my head over this problem for far too long... but I can't find any confortable solution.

I need to hide contextual tabs (i.e. TabTableToolsDesignExcel) from my custom ribbon. For normal tabs it is sufficient to create a tab with the same idMso from the designer but, with contextual tabs, this doesn't work. So anytime a user enter a table over a worksheet the contextual menu is shown.

Although I know it would work exporting to xml and creating all callbacks manually I'd really appreciate to avoid this way cos it requires a lot of effort...

Is there any trick to hide a contextual tabset or, even, to catch the context change event?

Thx in advance for your help.

1

1 Answers

0
votes

You can create a tab with the same IdMso value, but! instead of declaring the visible property use the getVisible callback. It is possible only with the custom UI XML markup, not designer. The callback will be called when the tab is going to be shown. In the handler you can return false to hide the tab. Hope it helps.

You can read more about the Ribbon UI in the Customizing the 2007 Office Fluent Ribbon for Developers article in MSDN.