WD: Renaming Top-Level Menus in Word for Windows

Last reviewed: January 30, 1998
Article ID: Q84904

The information in this article applies to:
  • Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
  • Word for the Macintosh, versions 6.0, 6.0.1

SUMMARY

Using the WordBasic RenameMenu command, you can rename the top-level menus in Microsoft Word. To add a new top-level menu item in Word 6.0 use the ToolsCustomizeMenuBar statement.

NOTE: It is not possible to add a new top-level menu in Word 2.0 for Windows (you can only rename existing menus).

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and 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 needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/supportnet/refguide/

Word 6.0 Syntax

 RenameMenu Menu$, NewName$, Type [, Context]

The Type parameter allows you to specify whether you want to modify the menus on the menu bar when a document is open or not. The Context parameter allows you to specify the Normal or Active template.

This example renames the Tools menu "Other Tasks" and makes ALT, O the key sequence that activates the menu:

   Sub Main
    RenameMenu "Tools", "&Other Tasks", 0
   End Sub

Word 2.0 Syntax

 RenameMenu MenuNumber, NewText$

The MenuNumber parameter is the number of the menu to rename (numbers 0-7), and "NewText$" is the new menu name.

To rename a menu in Word version 2.0 for Windows, follow these steps:

  1. From the Tools menu, choose Macro, and type a new macro name such as "Rename."

  2. Choose the Edit button.

The following sample macro renames the Window menu to Other Tasks:

   Sub Main
    RenameMenu 7, "&Other Tasks"
   End Sub

NOTE: The ampersand (&) preceding a character in the menu name sets an underlined access key for choosing the menu command.

The Word 2.0 menu titles and argument numbers are as follows:

Number    Title
------    -----
  0       File
  1       Edit
  2       View
  3       Insert
  4       Format
  5       Tools
  6       Table
  7       Window

To rename a menu in Word version 1.x for Windows, follow these steps:

  1. From the Macro menu, choose Edit.

  2. Type a new macro name such as "Rename."

The following sample macro renames the Macro menu to Other Tasks:

   Sub Main
    RenameMenu 6, "&Other Tasks"
   End Sub

The Word 1.x menu titles and argument numbers are as follows:

Number    Title
------    -----
 0        File
 1        Edit
 2        View
 3        Insert
 4        Format
 5        Utilities
 6        Macro
 7        Window

REFERENCES

"Microsoft Word for Windows Technical Reference," pages 76-77

"Microsoft Word for Windows and OS/2 Technical Reference," pages 242-243

"Using WordBasic," by WexTech Systems and Microsoft, page 271


Additional query words: winword2
Keywords : macword winword word6 kbcode kbmacro
Version : MACINTOSH:6.0,6.0.1,6.0.1a,;WINDOWS:1.0,1.1,1.1a,2.0,2.0a,2.0a- CD,2.0b,2.0c,6.0,6.0a,6.0c
Platform : MACINTOSH WINDOWS
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 30, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.