Microsoft KB Archive/65555

Word: Creating Multiple Autoexec Macros

PSS ID Number: Q65555 Article last modified on 11-02-1994

4.00 5.00 6.00

MS-DOS

= SUMMARY =

Microsoft Word only allows one macro named “autoexec” to be stored per glossary file. Word, by default, loads the glossary file NORMAL.GLY on startup. If a macro named autoexec exists in NORMAL.GLY, then the macro will be executed when Word loads.

However, there are times when more than one autoexec macro may be desired in order to automate processes within Word.

To create multiple autoexec macros in Word versions 4.00 and 5.00, use a batch file. The batch file copies a custom glossary file containing an autoexec macro into NORMAL.GLY prior to invoking Word. After invoking Word, the batch file can restore the true NORMAL.GLY file.

The following is an example batch file called MERGE.BAT:

Batch File Comments ———- ——–

cd Change to Word directory copy normal.gly normal.old Makes copy of NORMAL.GLY copy merge.gly normal.gly Installs new NORMAL.GLY word Starts Word, runs macro copy normal.old normal.gly Restores old NORMAL.GLY

Different glossary files can be created, each containing a different autoexec macro to run a different process. Different batch files can then be created to copy the appropriate glossary file to NORMAL.GLY before invoking Word.

KBCategory: kbother kbmacro KBSubcategory: Additional reference words: ============================================================================= Copyright Microsoft Corporation 1994.