Dragon Drop - A Visual Basic Software Consultancy

Word Tips

Placing code within Normal.dot

We see this a lot. People who write code which is expected to start at run-time for Word and fire up VBA for the first time and, aha!, see Normal.Dot. So, where do they put the code? Right, Normal.Dot.

This is to be resisted at all times. There is never any valid reason for placing code within Normal.Dot. Consider that one of the most common problems with Word is that the Normal.dot template gets corrupted and has be deleted; any code within Normal.dot would be lost. Secondly, Normal.dot is usually full of autotext entries and the like and the user's own personal options. If code was developed within Normal.dot and then given to another user they would lose all their settings and gain yours. Also, if they were to have their own code within Normal.dot then it would be lost.

We know that Word puts recorded VBA snippets into Normal.dot; but see it as just a scratch area for messing abut with code and, most definitely, not an area for hosting production code.

So, where to put code then? Well, Word gives you two choices of locations; the Start Up Folder or the Workgroup Folder. The Start up folder is for templates which are to be loaded at run-time and be maintained all throughout the Word session. The Workgroup folder is for the specific templates such as the Letter or the Memo template.

What then is the User folder for then? This is where the Normal.dot will live. It can point to the same folder as the Workgroup folder but it can be useful to have the workgroup folders on the local drive and the user folder with the user's area on the LAN so that the user's settings will travel around from machine to machine if they have roaming profiles set up.

But, back to the initial point. When does one have distribution code within the Normal.Dot? The answer is never.

Updates

If there are any suggestions for updates then please drop me a mail at malcolm.smith@dragondrop.com.