Causes for "WordBasic Err=100: Syntax Error"

Last reviewed: July 30, 1997
Article ID: Q95799
The information in this article applies to:
  • Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c

SUMMARY

This 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 Error

To 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
KBSubcategory:
Additional query words: 2.0 2.0a 2.0b 2.0a-CD 2.0c winword2
winword errmsg err msg syntax


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: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.