Microsoft KB Archive/113291

{|
 * width="100%"|

Entry Macro Runs Before AutoNew Macro in Protected Form

 * }

Q113291

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 6.0, 6.0a

-

SYMPTOMS
When you create a document based on a template that is protected for forms, Word for Windows runs the Entry macro in the first FORM field before it runs an AutoNew macro. The Entry macro runs before both global and template- based AutoNew macros.

If there is no Entry macro in the first FORM field, the AutoNew macro runs first, as usual.

STATUS
We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

WORKAROUND
If you need to run the AutoNew macro before the first Entry macro runs in a document based on a template that is protected for forms, you can run AutoNew from your Entry macro using the following procedure:

 Rename the AutoNew macro to a name that Word does not recognize as automatic (for example, rename AutoNew to NotAutoNew). See page 754 in the "Microsoft Word User's Guide" for instructions on renaming a macro.

Note: Macro names are not case sensitive. Open the Entry macro for the first FORM field. To find the name of the Entry macro assigned to that FORM field, double-click the field to open the Text Form Field Options dialog box.  Add the new name of the AutoNew macro to the beginning of your Entry macro, after the "Sub MAIN" line. The following is a sample Entry macro that first runs a renamed AutoNew macro:      Sub MAIN NotAutoNew MsgBox "Type your name here." End Sub 