Causes for "WordBasic Err=100: Syntax Error"Last reviewed: July 30, 1997Article ID: Q95799 |
The information in this article applies to:
SUMMARYThis article lists some of the more common reasons for a Microsoft WordBasic syntax error. When a syntax error occurs, WordBasic returns the following error message:
WordBasic Err=100: Syntax ErrorTo troubleshoot the error, open the macro in the macro editing window and run the macro. Word for Windows highlights the macro line that contains the syntax error.
MORE INFORMATION
No Sub Main Command in the Macro
If no Sub Main command exists in a macro, the first line of the macro is highlighted as being the offending command. Every macro must have a Sub Main command. A Missing Quotation Mark
A string must be enclosed by quotation marks (""). An error is generated if one or both are missing. For example, the syntax for the GetGlossary command specifies that the Name$ argument is a string ("GlossName"). A$ = GetGlossary$("GlossName", 1) A Missing or Extra Comma
Each argument for a statement or function must be separated by a comma. A missing comma or an extra comma generates an error. For example, each argument for the MsgBox command is separated by a comma. MsgBox "Delete File?", "Librarian", 289 A Missing Period
Each argument for a dialog-equivalent statement must begin with a period. For example, the FileOpen statement includes an argument named ".Name". FileOpen .Name = "MYDOC.DOC", .ReadOnly = 1 A Missing Reserved Word
Some WordBasic instructions include more than one reserved word. For example, an If conditional must include the Then reserved word. If n = 10 Then Beep A Reserved Word Name Conflict
WordBasic generates a syntax error if you create a variable name that matches a reserved word. For example, a variable named "Then" conflicts with the reserved word Then, which is part of a WordBasic If statement. A Missing Parenthesis at the Beginning or End of a Function
A function always includes an opening and closing parenthesis. A syntax error is generated if one or both are missing.Reference(s): "Using WordBasic," by WexTech Systems and Microsoft, page 343
|
KBCategory: kbmacro
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |