microsoft.com Home | |||
http://www.microsoft.com/office/ork |
Using the System Policy EditorControl IDs for Menu Commands and Toolbar ButtonsYou can look up control IDs for any item on a menu or toolbar in Microsoft Office 2000 applications by using Visual Basic for Applications (VBA). You enter the control ID into the System Policy Editor to disable that menu command and toolbar button. You can either look up a single control ID or use a macro to find a series of control IDs. Note Menu commands and their corresponding toolbar buttons share the same control ID. For example, the control ID for both the Save command (File menu) and the Save button (Standard toolbar) in Microsoft Word is 3. Finding a single control IDYou can use the Immediate window in VBA to look up the control ID for a single item on a menu. For example, the following command displays the control ID for the Save As command (File menu):
Note For Microsoft Excel, use “worksheet menu bar” instead of “menu bar” in the previous command. You use the same command to find the control ID for a toolbar button. For example, the following command displays the control ID for the Document Map button (Standard toolbar) in Word:
Finding all the control IDs for a menu or toolbarIf you want to find the control IDs for all the items on a menu or toolbar, you can create a macro in VBA. For example, the following macro opens a series of message boxes to display the commands and corresponding control IDs for each item on the File menu for any Office 2000 application:
Note To disable all of the items on a menu, you can enter each item individually in the System Policy Editor. Or, you can disable the entire menu by entering the control ID for the menu itself. See alsoFor more information about using Visual Basic for Applications, see the Microsoft Office 2000/Visual Basic Programmer’s Guide. |
Topic Contents | Previous | Next | Top Friday, March 5, 1999 © 1999 Microsoft Corporation. All rights reserved. Terms of use. | ||
License
|