Forum Discussion
VBA module in Word Normal Template not saved
I now work around the problem like this:
1. delete Normal.dotm and restart Word (which creates a new blank Normal.dotm)
2. set Word so that it doesn't automatically save Normal.dotm when you quit, but asks when Normal.dotm has been modified.
3. edit Normal.dotm and add a procedure called Autoexec which loads the code module (for example "MyCode.bas") when Word is launched.
4. Exit Word by answering YES (for the last time) to the question "Save the changes made to Normal.dotm".
5. The code module will be loaded automatically each time Word is opened. To save the code after modification, always use the Export function in the VBA editor (export to MyCode.bas).
6. Never save again Normal.dotm, always answer "NO" to the question about saving Normal.dotm when you quit Word.
It's not very elegant, but it works for me
Best regards,
Jean-Pierre
Hi Jean-Pierre,
The Normal template holds much more than vba. See Normal Template.
Much simpler is to put your code in a separate Global Template.
See Jay Freedman's answer on why you do not want to routinely keep your macros in Normal.dotm. "As a final suggestion, don't routinely save macros in Normal.dotm, precisely because that template is subject to many changes and mishaps are almost inevitable. Macros that you want to keep should be stored in one or more global templates, ones that are stored in the %appdata%\Microsoft\Word\Startup folder and automatically loaded at each startup of Word. The Normal template is handy for "scratchpad" macros but unreliable for anything more important." More on Global Templates.