Am 23.11.2013 00:41, schrieb Barry:
> Function IsRibbonVisible only returns "True" no matter if the Ribbon is visible or not.
>
> I am using the code below to hide or unhide the Ribbon:
> DoCmd.ShowToolbar "Ribbon", acToolbarNo
> DoCmd.ShowToolbar "Ribbon", acToolbarYes
>
> So need vba to tell me if the "Ribbon" is visible or not visible.
> Any ideas?
>
Hi Barry,
I've just tested the code with ACC2010(accdb) and it should work.
There is properly no easy way to get the visible status of the ribbon,
so the trick is, to construe the status from the control.height property.
The ribbon has to be enabled.
DoCmd.ShowToolbar "Ribbon", acToolbarYes
or DoCmd.ShowToolbar "Ribbon", acToolbarWhereApprop
Then toggle the Ribbon with <CTRL>+{F1} and get the height value of the
first control for each state
application.commandbars("Ribbon").Controls(1).height
You will get two different values. The boolean value is calculated then
with "controls(1).height > {your mean value}"
Maybe your mean value is different from mine?
Ulrich