Show/Hide ribbontab

Add-in Express™ Support Service
That's what is more important than anything else

Show/Hide ribbontab
 
kollanyipeter




Posts: 9
Joined: 2021-05-14
Hi,

I would like to show/hide a ribbon tab in an Outlook add-in. RibbonTab.Visible := True/False does nothing, so I looked around the forum and found this: "Hide TAdxRibbonTab on runtime" (https://www.add-in-express.com/forum/read.php?FID=1&TID=7637). I have tried this solution, but at me it does nothing. What could be the problem?

Regards,

P?ter
Posted 14 May, 2021 08:30:04 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello P?ter,

This can be a result of using a shared Ribbon tab: if your TadxRibbonTab.Shared is true, such a tab only has properties defined statically, not dynamically. Also, we've published a method that strips dynamic properties off the specified Ribbon tab component; the keyword is ReplaceGetVisibleWithVisible; see https://www.add-in-express.com/forum/read.php?FID=5&TID=12921.

Also, this can be a result of having a mess in the registry. Say you may have a per-user and per-machine versions of your add-in loaded. A way out of this would be to unregister the add-in and look for its traces in the Office UI.

Finally, you can try to do the same in a new sample add-in.


Andrei Smolin
Add-in Express Team Leader
Posted 14 May, 2021 09:25:21 Top
kollanyipeter




Posts: 9
Joined: 2021-05-14
Thank you for the quick response!

The problem is caused by the 'Shared' property. If I turn it off, I can hide the RibbonTab.

Unfortunately, 'Shared' was not accidentally set to true. I?Â?Ð?ém creating several Outlook add-ins that share a common RibbonTab, named as 'Nivelco' (after our Company). Different add-ins creates different RibbonGroups in this common RibbonTab. The plan is to automatically hide RibbonGroups that do not have any usable (visible) buttons. RibbonTab need to disappear if there is no visible RibbonGroup in it. Since our different users will have different add-ins installed, I would need to use the 'Shared' property to use this common 'Nivelco' RibbonTab. Do you have any suggestions for solving this problem?

Regards,

P?ter
Posted 14 May, 2021 10:33:28 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello P?ter,

If two add-ins add two Ribbon groups to a shared Ribbon tab, then turning off an add-in turns off the corresponding group. Turning the other add-in off turns of its group and the tab.

If you have more than two add-ins and if an add-in doesn't add a group to a tab, don't let that add-in create a tab!

kollanyipeter writes:
The plan is to automatically hide RibbonGroups that do not have any usable (visible) buttons.


Since you can't hide the tab (you don't have a means to hide a shared tab), you shouldn't hide the group and this means you shouldn't hide the buttons. Consider disabling them, instead.


Andrei Smolin
Add-in Express Team Leader
Posted 17 May, 2021 06:09:17 Top
kollanyipeter




Posts: 9
Joined: 2021-05-14
Thank you Andrei!
Posted 17 May, 2021 07:02:29 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
You are welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 18 May, 2021 05:02:04 Top