Access Ribbon

The Access 2010 toolbar ribbon can be minimised or hidden completely using VBA.

The height of the ribbon will vary according to the DPI of the display, when minimised the ribbon height will be around 50 - 75, when maximised it will be around 150 - 200.

The MinimizeRibbon command will (despite the name) toggle the ribbon state, so if the ribbon is already minimised it will maximise it. To ensure it is always minimised, run the command only if the height is greater than 100 (Maximized)

If commandbars("ribbon").height > 100 then
   CommandBars.ExecuteMso "MinimizeRibbon"
End if

Similarly to Maximize the ribbon:

If commandbars("ribbon").height <= 100 then
   CommandBars.ExecuteMso "MinimizeRibbon"
End if

To completely hide the ribbon:
DoCmd.ShowToolbar "Ribbon", acToolbarNo

To unhide the ribbon:
DoCmd.ShowToolbar "Ribbon", acToolbarYes

If you change the ribbon settings be aware this can affect other Microsoft Access databases.
If you minimise the ribbon when a database is opened it is a good idea to restore the default (maximised ribbon) when the database is closed. It does not affect other Office applications, Word etc.

"Round her neck she wears a yeller ribbon, She wears it in winter and the summer so they say, If you ask her "Why the decoration?" She'll say "It's fur my lover who is fur, fur away ~ George A. Norton


© Copyright SS64.com 1999-2016
Some rights reserved