Entry Macro Runs Before AutoNew Macro in Protected Form

ID: Q113291

6.00 6.00a WINDOWS kbusage kbmacro

The information in this article applies to:

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:

1. 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.

2. 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.

3. 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

REFERENCES

"Microsoft Word User's Guide," version 6.0, pages 318-319, 754

KBCategory: kbusage kbmacro KBSubcategory: kbtemplate Additional reference words: 6.00 6.00a autonew runs first macro form fields word6 winword autoentry auto-entry run macro on

Keywords          : kbtemplate 
Version           : 6.00 6.00a
Platform          : WINDOWS

Last Reviewed: February 6, 1998