WD97: Run-Time Error 1517 Running Converted Wordbasic MacroLast reviewed: February 11, 1998Article ID: Q163098 |
The information in this article applies to:
SYMPTOMSWhen you run a converted WordBasic macro you receive the following error message:
Run-time error '1517': Word cannot find the designated menu item. CAUSEThe converted macro contains a command that is missing arguments.
WORKAROUNDUse one of the following methods to work around this problem:
Method 1: Record the menu action in WordBasicUsing the version of Word that you used to create the original WordBasic macro, record the actions to perform the menu function, and then convert it to a Visual Basic for Applications macro.
Method 2: Convert the code to Visual Basic for Applications commandsEdit the converted macro in the Visual Basic Editor and replace the WordBasic commands with Visual Basic for Applications commands. For example, change this converted WordBasic command line,
WordBasic.ToolsCustomizeMenus Name:="MySubMenu", Context:=1, _ Menu:="MyMenu", Remove:=1to this Visual Basic for Applications command set:
Dim objMenuBar As Object Set objMenuBar = CommandBars.ActiveMenuBar.Controls("MyMenu"). _ CommandBar objMenuBar.Controls("MySubMenu").DeleteFor more information about CommandBars, from the Visual Basic for Applications Editor, click the Office Assistant, type "CommandBars," click Search, and then click to view "CommandBar Object." NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Microsoft Visual Basic Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q120802 TITLE : Office: How to Add/Remove a Single Office Program or Component |
Additional query words: 97
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |