Tip Disable the Ribbon & Office Button 2007 (1 Viewer)

ascaife

Registered User.
Local time
Today, 19:55
Joined
Nov 10, 2008
Messages
50
Hi All,

I'm sure many of you already know how this is done, but for any newbies like me who've spent ages searching this forum and loads of threads on other sites stating that it is not possible to disable the office button, this is for you. Apologies if this has already been mentioned in another tip.

Experts (certainly not me), if there's anthing I've done wrong here or if there's a better way to do this, please feel free to correct me.

1) Create a new class in VBA (I called mine Ribbon) with the following function in it:

Public Function DisableRibbon()
DoCmd.ShowToolbar "Ribbon", acToolbarNo
End Function

Make sure the function name is NOT the same as the class name, otherwise it won't run.

2) Create a new macro as follows:

Action:
RunCode

Function Name:
DisableRibbon()

Make sure you save the macro name as Autoexec, this tells access to run the macro on startup.

That's it !!!

All you have to do now is exit your database and re-open.

Awesome stuff if you're trying to make your database look and feel like it's a program in its own right.

Good Luck.
 

drisconsult

Drisconsult
Local time
Today, 08:55
Joined
Mar 31, 2004
Messages
125
Hello
I have used your code and I can hide the ribbon by running the autoexec macro. However when I load my program in runtime mode, the autoexec is not loaded. I also need to hide the Microsoft Office button

drisconsult
London
 

isladogs

MVP / VIP
Local time
Today, 08:55
Joined
Jan 14, 2017
Messages
18,186
You can instead run the code in the load event of your start up form.
You may need to remove the application window to get rid of the Office button in 2007.
Have a look at my example database Control the Application Interface

It was developed in A2010 so certain features may not work in A2007

NOTE You replied to a ten year old thread and the author hasn't been active here since 2010
 

Solo712

Registered User.
Local time
Today, 04:55
Joined
Oct 19, 2012
Messages
828
You can instead run the code in the load event of your start up form.
You may need to remove the application window to get rid of the Office button in 2007.
Have a look at my example database Control the Application Interface

It was developed in A2010 so certain features may not work in A2007

NOTE You replied to a ten year old thread and the author hasn't been active here since 2010

Hi Colin,
this is a useful set of utilities. Just as a heads up: the resize form utility does not reset the default screen resolution constants(which are 800 and 600) on exit and as a result the windows screen may lose the start button and taskbar, if the native windows resolution is higher. I experimented with res constants of 1600x900 and 1920x1080 and with those the taskbar is displayed on exit. (Tested with Access 2013).

Best,
Jiri
 

isladogs

MVP / VIP
Local time
Today, 08:55
Joined
Jan 14, 2017
Messages
18,186
Hi Jiri
I've been using the automatic form resizing code in almost all my apps for almost 15 years.
The issue you describe cannot occur because the user's resolution is NOT changed by using the code.

The 800*600 values (which can be modified as desired) are the base resolution values from which the forms are scaled up to each user's screen resolution. Basically each form in design view is sized such that if the resolution was 800*600, the form would fill the screen.
In form view, the code ensures the form scales up by the amount required for any screen or resolution higher than 800*600

I wrote an extended tutorial explaining how to use the automatic form resizing code.
You can find it at http://www.mendipdatasystems.co.uk/automatic-form-resizing-1/4594554784
There is an example database to accompany the article
 

Users who are viewing this thread

Top Bottom