Compile error running Pleading Wizard (209711)



The information in this article applies to:

  • Microsoft Word 2000
  • Microsoft Word 97 for Windows

This article was previously published under Q209711
This article is a consolidation of the following previously available article: 261435

SYMPTOMS

When you try to create a new pleading document with the Pleading Wizard in Microsoft Word, you may receive one of the following error messages:
Compile error in hidden module: ThisDocument
Compile error: Only comments may appear after End Sub, End Function, or End Property

CAUSE

This problem occurs when the Require Variable Declaration check box is selected in the Visual Basic Editor.

WORKAROUND

To prevent this problem, click to clear the Require Variable Declaration check box before using the Pleading Wizard. To do this, follow these steps:
  1. In Microsoft Word, point to Macro on the Tools menu, and click Visual Basic Editor.
  2. In the Visual Basic Editor, click Options on the Tools menu.
  3. On the Editor tab of the Options dialog box, click to clear the Require Variable Declaration check box.
  4. Click OK to close the Options dialog box.
  5. On the File menu, click Close and Return to Microsoft Word.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

The Require Variable Declaration check box determines whether explicit variable declarations are required in modules. Selecting this option adds the "Option Explicit" statement to the general declarations in any new module.

Modification Type:MajorLast Reviewed:5/25/2006
Keywords:kbbug kbnofix KB209711