Save Menus Changed By VBA?

B

BobV

Group:

How do I save a change I made to a menu item through the following VBA
subroutine? The code below will put a checkmark next to the following menu
item: Switchboard Menu > Options > Compact Database Before Exit

However, the change is not saved by my sub. What is the VBA statement to
save the change I made to the Switchboard Menu before the user exits from my
application?

Thanks,
BobV

'COMPACT ON EXIT
Sub CompactOnExit()
CommandBars("Switchboard
Menu").Controls("Options").CommandBar.Controls("Compact Database Before
Exit").State = msoButtonDown
CommandBars("Switchboard
Menu").Controls("Options").CommandBar.Controls("Do Not Compact Database
Before Exit").State = msoButtonUp
Application.SetOption "Auto Compact", True
End Sub
 

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