OFF97: Cannot Turn Off Customize Dialog Box by Using Macro to Disable Toolbars Submenu (248689)
The information in this article applies to:
- Microsoft Office 97 for Windows
This article was previously published under Q248689 SYMPTOMS
When you try to turn off the Customize dialog box (on the View menu, click Toolbars) by running the following Visual Basic for Applications code
Application.CommandBars("Toolbar List").Enabled=False
the Customize dialog box still appears when you double-click a blank area of a toolbar. NOTE: The preceding code turns off the Toolbars submenu on the View menu.
CAUSE
Office 97 does not allow you to have direct control over built-in dialog boxes.
WORKAROUNDMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
You cannot completely turn off the Customize dialog box in Office 97. However, you can turn off the functionality within the dialog box itself by inserting the code that is included in the following steps:
- Start an Office 97 program.
- Press ALT+F11 to open the Visual Basic Editor.
- Insert the following macro into a code module:
Sub DisableCustomizeDlgUsage()
Dim cb As CommandBar
On Error Resume Next
For Each cb In Application.CommandBars
If cb.protection <> (msoBarNoChangeDoc + msoBarNoResize) Then
cb.Protection = msoBarNoCustomize + msoBarNoChangeVisible
End if
Next
End Sub
- Run the macro, and then open the Customize dialog box.
- Try to modify a toolbar or toolbar button.
MORE INFORMATION
You can turn off the Customize dialog box by removing the Toolbars submenu from the View menu. However, if you right-click or double-click on an empty spot on a toolbar, the Customize dialog box appears again.
NOTE: Although Office 97 does not give EventHandler access to CommandBars to circumvent this behavior, Microsoft Office 2000 does.
Modification Type: | Major | Last Reviewed: | 6/18/2005 |
---|
Keywords: | kbbug kbdtacode kbfix KB248689 |
---|
|