Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Platform independent code to hide the 2007 ribbon

Status
Not open for further replies.

anubis2k11

Programmer
Jan 22, 2011
2
0
0
US
Hi,

I'm looking for a way to hide the ribbon in access 2007.

this website


has a method to hide the ribbon. The sendkeys statement works, but the test to see if the ribbon is hidden or not (fReturnRegKeyValue) uses a registry key. This is fine if you are installing on a single OS, but I will be installing my app on Win7, xp and 2003. Consequently the registry is different on each os, and I'd like a method that has a test that's platform indenpendent.

Any ideas? Thanks.
 
To hide the ribbon:

DoCmd.ShowToolbar "Ribbon", acToolbarNo

To unhide it:

DoCmd.ShowToolbar "Ribbon", acToolbarYes



 
A couple of notes:
1. SendKeys should only be used as a last result for anything, as it can be QUITE messy. And since you would want to put the code in VBA, which is within the Office application, it'd not make sense to "send" anything out of the application, to have it return an action to the same application.
2. Anything that updates the registry for any sort of fixes is bound to end up being problematic assuming this is installed on ANY machines that have user-level privileges in Windows. Even at Admin level, login-scripts will often disbable access to the registry.

Let us know how StarPassing's suggestion works - it looks correct, I've just never tried it. I might sometime soon, though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top