Modify the Office Button?

T

tkosel

I have an Access 2007 database that I am going to distribute using the
Package Deployment Wizard and Access 2007 run time. It is a highly automated
app and does not require the user to do very much. In fact, I want to keep
user interaction to a minimum, including unwanted actions!

I know how to eliminate the ribbon, and have a way to keep the user from
exiting using the control box exit button or the right click on the taskbar
icon and select close.

However, I cannot figure out a way to either get rid completely or the
Office Button (I have heard it refferred to as the "Belt Buckle") or to
eliminate the "Close Database" and "Exit Access" buttons.

Does anyone know how to do this?
 
J

Jon Lewis

Don't think you can get rid of the office button but you can modify it by
having a custom ribbon with XML similar to below. The example below has no
tabs, disables Help and modifies the Office button:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
<commands>
<command idMso="Help" enabled="false"/>
</commands>
<ribbon startFromScratch="true">
<officeMenu>
<button idMso="FileOpenDatabase" visible="false" />
<button idMso="FileNewDatabase" visible="false" />
<button idMso="FileCloseDatabase" visible="false" />
<splitButton idMso="FileSaveAsMenuAccess" visible="false" />
</officeMenu>
</ribbon>
</customUI>

See http://www.accessribbon.de/en/index.php?Welcome for Ribbon stuff

HTH

Jon
 
M

Maurice

Easiest way to get rid of it all:

DoCmd.ShowToolbar "Ribbon", acToolbarNo

in the form load of you startup form. Leaves you with nothing.
 
T

tkosel

Maurice,

Thanks for your suggestion, I love the idea, but cannot get it to work. It
seems so simple. When my startup form loads, I have place your code in the
Load event of it, the code runs, but the button is still there.
 
T

tkosel

John,

Thanks a lot for you suggestions. I like your suggestion, but when I copy
and paste your xml into a new record in my UsysRibbons table, specify that
ribbon for the current database, stop and restart, I get an error in the xml
message. LIne two, column 3 it says. Any ideas?

If I can get it to work, do you know if there is xml to eliminate the Exit
Access button?
Something like: <splitButton idMso="FileExitAccess" visible="false" />
 
M

Maurice

Hmm Strange. I just tried it in Access 2010 and it works as expected.
Packaged it, installed it and no ribbon to be found. I don't have 2007
hanging around on this pc i'll try tomorrow and let you know.
 
E

ericb

I'm on Access 2007 and i put the line of Maurice in the On open event of my
main form and it works just fine.

The only things left are my application title and application icon. Those
are set in Application Options.
 
M

Maurice

Hi Eric,
Thanks for confirming that. I'll give it an extra try on my other pc to see
if i can confirm it again...
 
M

Maurice

tkosel,

I just added a package with Acc 2007 and got the same result as with 2010.
So no Office Button nor Ribbon. There must be something else. Is there
something else you are trying to add such as a user defined toolbar?
 
J

Jon Lewis

Sorry - it was missing a closing chevron on the first line so try this:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<commands>
<command idMso="Help" enabled="false"/>
</commands>
<ribbon startFromScratch="true">
<officeMenu>
<button idMso="FileOpenDatabase" visible="false" />
<button idMso="FileNewDatabase" visible="false" />
<button idMso="FileCloseDatabase" visible="false" />
<splitButton idMso="FileSaveAsMenuAccess" visible="false" />
</officeMenu>
</ribbon>
</customUI>

I don't think you can remove the Exit Access button by this method

Jon
 
T

tkosel

Maurice and others,

I think I might be making some progress! Started a new project, kept it
simple. The line "DoCmd.ShowToolbar "Ribbon", acToolbarNo" works! However,
I still have a major problem! The Control Box including the close button is
visible in the Access Window! I only want the user to be able to exit using
the way I have designed for him/her on the form. (I realize that they will
still be able to exit using the task manager if they really want to, but I
will have to live with that!) Any ideas?
 
T

tkosel

Jon,

Thanks for your response. Was able to get it to work. Looks like I need to
better familiarize myself with XML stuff! I wish that you could get rid of
the "Exit Access" choice, but that isn't permitted. (I tried;

<button idMso="FileExitAccess" visible="false" />

but it didn't like that.

Interestingly enough, I do have some code that disables the Access close
dialog in the Access control box and the file close menu choice. However, if
you customize a ribbon, it ceases to work. I can have one or the other, not
both! Any ideas why that is?
 
J

Jon Lewis

Not without seeing the code.


tkosel said:
Jon,

Thanks for your response. Was able to get it to work. Looks like I need
to
better familiarize myself with XML stuff! I wish that you could get rid
of
the "Exit Access" choice, but that isn't permitted. (I tried;

<button idMso="FileExitAccess" visible="false" />

but it didn't like that.

Interestingly enough, I do have some code that disables the Access close
dialog in the Access control box and the file close menu choice. However,
if
you customize a ribbon, it ceases to work. I can have one or the other,
not
both! Any ideas why that is?
 
T

tkosel

Maurice and others,

I think this may be the last question regarding this issue from me! I hope
so anyhow. I have it sort of working. If I place the command
"DoCmd.ShowToolbar "Ribbon", acToolbarNo" in the load event of my startup
form, then open it in form view, it works fine. (I have discovered another
way to deal with the close dialog that is available in the window.)

However, if I create a shortcut to the ACCDB file, or double click the file
name in explorer; when the db launches, lo and behold the office button and
toolbar are back! Do you know why this is? What can I do about it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top