Word is a complex application, and I tend to occupy its wilder shores. This monologue is about the file that is the Normal Template, about where and how to find it, about how you can control what it is called and where it lives, and about some of the weird and wonderful things that can happen. If you are interested in exploring some of the more obscure mechanics of Word, read on, but ...
This article is not about how Word uses its Normal Template, or what it keeps in it; it is not about how you can use your Normal Template to control the format of your documents, or to make editing of them easier. If you want more of that kind of end user-oriented information, I can recommend articles by Word MVPs Dian Chapman (Normal.dot Template — ExplainedNormal.dot Template — Explained [link to Dian’s article – “Normal.dot Template — Explained” – at http://pubs.logicalexpressions.com/pub0009/lpmarticle.asp?id=151]) and Suzanne Barnhill (How to change the default settings for Word documentsHow to change the default settings for Word documents [link to Suzanne’s article – “How to change the default settings for Word documents” – at http://word.mvps.org/faqs/customization/CustomizeNormalTemplate.htm]). It is also probable that there is some good information amongst the total disorganisation that is the Word Team BlogWord Team Blog [link to the Word Team Blog at http://blogs.office.com/b/microsoft-word/], but I don’t know how to find it.
Word works with Templates; it can’t do anything without Templates. Every Document has one, and Word, itself, has one. If you don't provide a Template it can use, Word will create one for you from a set of built-in defaults. Whatever the source of Word’s Template, however, it does belong to you: you use it however you see fit, to make Word work the way you want. Knowing something about it can only help you.
Before deciding to write this, I searched for other authors’ take on the subject – and found none that were even close to complete; there are a couple of Microsoft Knowledgebase articles on the location, and one blog post by Office System MVP Mourad Louhablog post by Office System MVP Mourad Louha [link to http://www.excel-ticker.com/use-own-filename-for-the-normal-dot-template-in-word/], but that was all I could find. I hope others will come to the subject in the future but, for the moment, this seems to be an almost unique page.
Whilst I have attempted to provide a complete picture, and written far more than I originally intended, there are so many possible different situations that I may have missed one or more circumstance that exhibits behaviour different from that which I have described. Do, please, let me knowlet me know [link to e-mail the author at mailto:Tony@WordArticles.com] if you know of any such, or if you think I have made any mistakes or missed out any important points.
This article refers to the registry in several places. As it seems to be de rigueur not to mention the registry without a concomitant warning of doom and destruction should you make a mistake, consider yourself so warned.
There are some esoteric file types that Word knows about, but for all practical purposes, Word works with Documents and Templates; these are superficially similarly constructed files, as is easy to see if you peek inside them. They are, however, different, and Word knows the difference and you can’t use a document as a template, or vice-versa.
Prior to Word 2007 it was not a requirement of Word that filenames had any particular suffixes, or extensions (the, traditionally, three, although now sometimes four, characters after the final dot in the filename), but it was usual for documents to be ".doc" files, and templates to be ".dot" files and many aspects of working with Word were built around the assumption that those extensions would be used. Whilst only the truly perverse would have a document called "MyDoc.dot" based on a template called "MyDot.doc", it was possible, but the document was still a document, and the template a template, and Word knew the difference and ignored the extension.
Word 2007, with its new file formats, has changed the picture slightly. It still works with Documents and Templates, but it has introduced the concept of Macro-Enabled Documents and Templates, and given extra significance to the filename extensions. The new extensions, which can only be used on files of the appropriate type are: ".docx" for ordinary Documents without macros or other ‘active’ content, ".docm" for Macro-enabled Documents, ".dotx" for ordinary Templates without macros, and ".dotm" for Macro-enabled Templates.
Internally, as well as the differences between Documents and Templates, there are, now, differences between Documents and Macro-Enabled Documents, and Templates and Macro-Enabled Templates. Word 2007 will not open, for example, a Macro-Enabled Document with a ".docx" extension, so it is not possible for a Document to be called "MyDocx.dotx", or its Template to be called "MyDotx.docx". A document is still a document, though, and a template a template, and Word knows the difference, and it only validates against the new extensions. All files with other extentions are treated according to their contents and it is still possible, and still perverse, of course, to have, say, a Word 2007-format document called "MyDocx.dot" based on a Word 2007-format template called "MyDotx.doc".
Word uses a Template, its Normal Template. The Normal Template is just a Template, a template like any other; it differs from other templates only in the way in which it is opened, and all that makes a Template the Normal Template is being opened as the Normal Template. Any template can be used as the Normal Template, and what you think of as your Normal Template can be used as an ordinary Document Template.
All that said, however, the Normal Template is special. There are some things (formatted AutoCorrects, for example), however, that, although they can be stored within any Template, can only be accessed in Word when the template is opened as Word’s Normal Template.
The Normal Template has existed, essentially unchanged, as far as I know, since the first days of Word. A minor technical change was made in Word 2007 in line with the new file types and the Normal Template is now a Macro-Enabled Template. There are some behavioural changes that follow from the validation of the file extensions, but Word 2007’s Normal Template is still a Template like any other, except that, when saved by Word, it is saved as a Macro-Enabled Template, with a ".dotm" extension in normal circumstances.
The particular instance of Normal Template that Word uses is determined according to a set of rules – similar to those it uses for Document Templates. If all else fails, Word, of course, has some built-in defaults, but it will, for preference, use whatever file you tell it to, and take it from the location you decide. Exactly what Word does by default, and what you can tell it to do instead, and how you can tell it, varies slightly according to the version and release of Word that you are using.
A long time ago there was a product called Word 97. Like its predecessors, it had a basic mechanism for finding its Normal Template, from which the current process has evolved. It looked in its Templates directories, and its own directory, before falling back on its built-in default. Should you be interested, there are Microsoft web pages on the subject for Word 97Word 97 [link to KB Article for Word 97 at http://support.microsoft.com/kb/198039] and for earlier versionsearlier versions [link to KB Article for earlier versions of Word at http://support.microsoft.com/kb/94732], which I believe to be correct.
It was in Word 2000 that the basic procedure that is still followed today, was laid down. There are Microsoft web pages on this subject, too, for Word 2000Word 2000 [link to KB Article for Word 2000 at http://support.microsoft.com/kb/214215], for Word 2002Word 2002 [link to KB Article for Word 2002 at http://support.microsoft.com/kb/291446], and for Word 2003Word 2003 [link to KB Article for Word 2003 at http://support.microsoft.com/kb/826839], but none of these appear to be completely accurate, and none of them mention the name of the Template. In the rest of this article the oldest version to which I refer is Word 2003, but, as far as I know, what I say about Word 2003 applies equally to Word 2002 and Word 2000.
Word 2007, of course, was a step change in many ways. The basics remained the same but the new file formats introduced an extra level of complexity. Microsoft seems to have decided not to attempt to describe what happens now.
For absolute clarity let me state, firstly and simply, that most users will find their Normal Template, called Normal.dot (in Word 2003), or Normal.dotm (in Word 2007 or Word 2010), in their User Templates folder, usually located at "%appdata%\Microsoft\Templates", and only if it is not there should they consider looking elsewhere, or for a file of another name.
Since Office 2000, Word has looked for its Normal Template in, or relative to, one of three places:
In the same way that the first place in which modern versions of Word look for a Document’s Template is the folder containing the document, so the first port of call for Word’s Template is the folder containing Word. It is unusual for modern versions of Word to find a template there, and the next place Word looks is the place where most users will actually have their Normal Template, the User Templates folder. Although some misguided systems administrators do attempt to do strange things, it is probable, even in a corporate environment, that this is where you will find yours.
According to the Microsoft KnowledgeBase articles mentioned above, the search order varies depending on whether the installation option “Run from My Computer” or “Run from Network” is chosen. These articles are incorrect in what they state about using the “Run from My Computer” option; I do not know whether they are right or wrong with regard to the “Run from Network” option.
If you are a normal user (i.e. not an administrator) in a corporate environment you will probably find that you don’t have write authority to the folder where the Word executable is. Even if you are on your own computer, and do have administrator privileges, modern versions of Windows will make it awkward for you, although you should be able to do it with a little perseverance. That said, placing your Normal Template in Word’s Program Folder is not a course of action I would recommend.
Word can, of course, be installed anywhere, and even the default varies according to Word and Windows versions. For Word 2010 on a 32-bit Windows system, the default location is "C:\Program Files\Microsoft Office\Office14". There are complicated ways of finding out exactly where it is, but the easiest way is to ask Word. To do this in English:
As far as I can tell from some cursory investigation, the steps are the same in all languages, although the "Immediate" window may be called, for example, "Exécution", "Verificação imediata", or "Direktfönster", and the Ctrl key may be called, say, the Strg key.
The default location of Word's Normal Template is what Word calls the "User Templates" location, and the default for this, on an English system, is "%appdata%\Microsoft\Templates". If you have installed Word in Norwegian, say, as I did, then the default name will be "%appdata%\Microsoft\Maler" and this can cause a few problems, but neither the situation nor the problems will be mentioned further here.
%appdata% is what is called an Environment Variable; I use it because it allows me, concisely, and precisely, to specify the location. You can use it, too: just type it into the address bar of any Windows Explorer window and Windows will take you there – even if the location is, as it is by default, hidden. On a default English Windows XP system, %appdata% is "C:\Documents and Settings\user-name\Application Data"; on Windows 7, it is "C:\Users\user-name\AppData\Roaming". The actual folder name will have user-name replaced by whatever your user name is; on my Windows 7 system, for example, the actual folder name is "C:\Users\Tony\AppData\Roaming". If I change my UI language, "Users" might show as "Utilisateurs", say, or "ユーザー", but that is just a trick that Windows plays, and the folder is still called, and can be referred to as, "Users". On other versions of Windows, the name may be different, and, as it can be configured by administrators, it could, in theory, be almost anything.
Whatever the default, what matters is the actual location, which, if it has been changed from the default, is held in the Registry. It is an Office-wide setting, used by several Office applications, but only Word provides a way to change it, or even view it, via the User Interface. The registry setting is in the HKCU\Software\Microsoft\Office\vv.0\Common\General key (where "vv.0" is 14.0 for Office 2010, 12.0 for Office 2007, 11.0 for Office 2003, etc.), and the Value is called UserTemplates.
Prior to Word 2007, to see, or change, the location in Word, just needed a couple of clicks (Tools > Options > File Locations tab). As with most things, it is now a little harder to reach and, in Word 2010, you must go to File > Options > Advanced tab, scroll to the bottom and click on the File Locations button. However you get there, it is the place to find out what the location is set to. Alternatively, you can ask Word, as described above, except that this time the text to enter is "?Options.DefaultFilePath(wdUserTemplatesPath)" (without the quotes).
Word does not have a default location for what it calls "Workgroup Templates". It is intended as a location, probably on a network, where shared read-only Templates can be maintained. Microsoft state that you need full read/write access to your Normal Template and that it should not be shared, so it is slightly bizarre that Word ever chooses to look in what is intended as a shared location; Word, however, will open (though not automatically save) a shared Normal Template in Read-Only mode.
Like the User Templates location, the Workgroup Templates location is an Office-wide setting, changeable via the Word UI, and it is held in the same registry key, in the value called SharedTemplates. To ask Word what the location is, you use "?Options.DefaultFilePath(wdWorkgroupTemplatesPath)" (without the quotes).
The default, and usual, name of Word’s Template prior to Word 2007 was Normal.dot, and, since then, it has been Normal.dotm. There is, though, a registry value you can set to override this. It is in the HKCU\Software\Microsoft\Office\vv.0\Word\Options key (where "vv.0" is the Word version number, as described above), and the Value is called "GlobalDotName".
This registry Value can hold the name in a variety of formats, and the actions taken by Word, especially Word 2007 and Word 2010, vary according to the format. In, roughly, increasing order of complexity the possible formats are:
Relative paths to higher level directories can be specified as they can most anywhere, so a value of "..\AlternativeTemplates\Normal" will cause Word to use a different folder, "AlternativeTemplates", within the same parent folder as its usual "Templates" (or other) folder. Whilst you can be as inventive as you like with this, do remember that Word will be searching relative to each of the locations in which it thinks it may find its template.
Given the defined folder search sequence, and the registry value for the name, Word knows exactly what to look for and where, but what does it do when it has found, or failed to find, any instance of the template it needs? That depends on the version of Word; Word 2003 had a relatively simple process, but Word 2007 and Word 2010 have to take account of more factors and have a considerably more complex process.
Using either the name specified in the registry, with a defaulted ".dot" extension if need be, or its built-in default of "Normal.dot", Word 2003 knows exactly what its Normal Template is going to be called, and it searches each of its locations in turn looking for a file of that name. There are, essentially, three possible outcomes from the search: a file is either found (in which case it is either valid or not valid) or one is not found.
If a file is found and it is a valid 97-2003 format Template, all is well, and Word will use it.
There is one special case that Word 2003 does not handle well: if you try to call your Normal Template ".dot" (or ".com", or any name with nothing before the dot), Word will use it and work just fine until you come to save it.
If you explicitly save during your Word session, the template will not be saved and you will not be told. Word, however, will think it has been saved and does not, therefore, need saving again unless further changes are made; if you close Word without making further changes, all your changes will be, in effect, discarded.
If you have the option set to prompt before saving the Normal Template at shutdown, and you reply ‘Yes’ to the prompt, nothing will happen. You will not be told anything but Word just won't close. If you reply ‘No’ to the prompt, Word won't try to save the template and all will be well (apart from losing your updates, of course).
If you do not have the option set to prompt before saving the Normal Template at shutdown, and the Normal Template has been changed during the Word session, Word 2003 will try to save the file, and fail, and try again, and fail again, and keep on trying and failing until you cancel Word through the Windows Task Manager.
If a file is found, but it is not a valid 97-2003 format Template, Word 2003 will ignore it, and create a new Normal Template based on its built-in defaults. When Word creates a new Normal Template:
It gives it the name determined from the registry entry, if present, but ignores any full or partial path that may have been specified.
Word creates the new template in memory, it does not create it on disk, but it presumes it will be saved in the User Templates location – and, in the absence of explicit action specifying otherwise, it will be.
If you try to save the new Normal Template via VBA, you will get an error, number 5986: “This command is not available on an unsaved document”.
You can use this fact to determine, in VBA, whether or not the Normal Template is a new, unsaved, one. The code is really quite simple, but it does have a, probably undesirable, side effect: if the Normal Template existed prior to the current Word session, or it has already been saved during the current session, this code will save it.
Function NormalTemplateIsNew() As Boolean On Error Resume Next NormalTemplate.Save NormalTemplateIsNew = Err.Number = 5986
Should you actually want to save a new unsaved Normal Template in VBA, of course, you will find this feature somewhat irritating. You can, however, work around it very easily, although I cannot find a way to entirely hide the action from the user interface:
If you query the path of an unsaved Normal Template in VBA, it will report the User Templates location. If you change the User Templates location and query the path of the Normal Template again, it will report the new User Templates location.
Whilst the code is somewhat more involved than that presented earlier, this behaviour does provide an alternative way to check, in VBA, whether or not the Normal Template is a new, unsaved, one, in a way that leaves the environment untouched. There are some brief comments in the code, presented as is: take it or leave it!
Function NormalTemplateIsNew() As Boolean ' Two valid folders are needed. One is supplied by Word; ' .. the other determined here: we use the drive root, ' .. or the default if the root was already being used. ' .. Caveat: if the default User Templates folder is ' .. the root of a drive (possible, I think, with ' .. folder redirection) this will fail.
' I believe, but cannot test, that this should work on a Mac. Dim UTPathOrig As String Dim UTPathTemp As String UTPathOrig = FormatPath(Options.DefaultFilePath(wdUserTemplatesPath)) ' If no change when truncated at separator, use default UTPathTemp = Left(UTPathOrig, InStr(UTPathOrig, Application.PathSeparator)) If UTPathTemp = UTPathOrig Then UTPathTemp = "" NormalTemplateIsNew = False If FormatPath(NormalTemplate.Path) = UTPathOrig Then ' Might be new and unsaved Options.DefaultFilePath(wdUserTemplatesPath) = UTPathTemp UTPathTemp = FormatPath(Options.DefaultFilePath(wdUserTemplatesPath)) If FormatPath(NormalTemplate.Path) = UTPathTemp Then ' Must be new and unsaved NormalTemplateIsNew = True End If Options.DefaultFilePath(wdUserTemplatesPath) = UTPathOrig End If End Function Function FormatPath(Path As String) ' Paths may be returned from Word in any combination of case ' Trailing path separators are sometimes returned on paths, ' .. and sometimes needed, but they are never wrong ' This returns paths in upper case with a trailing separator FormatPath = UCase(Path) If Right(FormatPath, 1) <> Application.PathSeparator Then FormatPath = FormatPath & Application.PathSeparator End If End Function
If the new Normal Template is saved, either during the Word session or on exit from Word (by default, or, if the option to prompt is in effect, by responding positively to the prompt), there may already be a file of the same name in the User Templates folder. This can happen when Word has, for example, found an invalid template in its program folder, and not checked further, and not found what might be a valid file in its User Templates location. It can also happen if the User Templates location is changed before the Normal Template has been saved, and changed to a location that already has a file of the same name as the Normal Template. In either of these cases Word will prompt for permission to overwrite and, if denied, will throw a SaveAs Dialog for the user to save it under another name and/or in another location.
There is one unusual case of an invalid file being found that seems to be too much for Word 2003 to handle. If the file that is found is a valid 97-2003 format Document and, thus, not a valid Template, Word 2003 does create a new Normal Template as it does when any other invalid file is found. Having created this new Template, however, Word doesn’t then seem to know quite what it has created or what it should do with it or where it should save it or what it should save it as, and some operations can cause it to crash. Just my personal view, of course, but I would avoid doing this!
If a file is not found, Word will create a new Normal Template based on its built-in defaults, as described above, just as it would had an invalid file been found.
Using either the name specified in the registry, with a defaulted ".dotm" extension if need be, or its built-in default of "Normal.dotm", Word 2007, just as Word 2003 before it, knows exactly what its Normal Template is going to be called, and it searches each of its locations in turn looking for a file of that name. Although, in principle, there are the same three possible outcomes from the search as there were in Word 2003, Word 2007 actually presents a far more complex picture than you might at first imagine.
If a file is found and it is a valid 2007 format Macro-Enabled Template with a ".dotm" extension, all is well, and Word will use it. There is one caveat to this, and, generally, to all that follows, which is detailed in the section below, headed “Trust”.
If a file is found and it is a valid 2007 format Template (not Macro-Enabled), with a ".dotx" extension, Word will use it. However, if the Normal Template is saved, either during the Word session or on exit from Word (by default, or, if the option to prompt is in effect, by responding positively to the prompt), it will be saved as a Macro-Enabled Template, but still with the ".dotx" extension it has been told to use. The next time Word tries to use this file it will fail (as described below) because its type and its extension (being one of the new ones that Word validates against) do not match.
If a file is found and it is a valid Template in any format (97-2003, 2007, or 2007 macro-enabled format) and its extension is anything other than one of the new extensions (".docx", ".docm", ".dotx", or ".dotm"), Word will use it. However, if the Normal Template is saved, either during the Word session or on exit from Word (by default, or, if the option to prompt is in effect, by responding positively to the prompt), it will be saved as a Macro-Enabled Template. This time, however, the extension of the saved file will be whatever it had been specified as, and not one that Word validates, so Word 2007 will continue to work normally with it when next invoked.
If a file is found and it is a valid Word 97-2003 format Template, and it is called ".dot" (or ".com", or any name with nothing before the dot, except ".dotm" or any of the other new extensions), Word 2007 does not cope well. Word will create a new Template based on the file but will fail to save it in essentially the same way as Word 2003 before it, with one slight difference: if you close Word and you do not have the option set to prompt before saving the Normal Template, Word 2007 will keep on trying and failing to save, but it appears as though it checks the registry on each attempt. If, while Word is stuck in its loop, you change the registry entry to a name that Word finds acceptable, it will immediately show a SaveAs dialog with this new name as the default.
If a file is found and it is a valid Word 97-2003 format Template, and it is called, simply, ".dotm" (or ".dotx", or ".docm", or ".docx"), Word 2007 will just ignore it and, otherwise, behave as above.
If a file is found and it is anything other than a valid Word 97-2003 format Template, and it is called ".dotm" (or ".dot", ".chocolate" or any name with nothing before the dot), Word will issue an error message and fail to open the file. Again, otherwise, Word 2007 will behave as above.
If a file is found and it has one of the new extensions (".docx", ".docm", ".dotx", and ".dotm"), before doing anything else Word will validate it as being of the appropriate type. If it fails this validation, whether or not it is an otherwise valid template, Word 2007 will not open the file, and, will issue a helpful error message, such as "there are problems with the contents", or "the file is corrupt", or "no error detail available", or "some parts are missing or invalid". Having failed to open the file, Word will then create a new Normal Template based on its built-in defaults. This process is essentially the same as in Word 2003, the differences being with what happens when the new Normal Template is saved.
Word 2007 still presumes it will be saving its new template in the User Templates location in so much as that is what it reports in VBA, but it does take note of the path when it comes to actually saving. If an absolute path is specified in the registry entry, Word will save the Normal Template in the specified folder, if it exists. If a relative path is specified in the registry entry, Word will save in that location relative to the User Templates folder, if it exists. If no path is specified in the registry entry, or if the path specified does not exist, Word will save the Normal Template in the User Templates folder.
Regardless of the extension specified, Word will save its new Normal Template as a Macro-Enabled Template. If the specified extension is ".docx", ".docm", or ".dotx", this will lead to creation of a file that Word will then refuse to open and Word creating another new Normal Template each time it is invoked, which new one will repeatedly overwrite the previous one.
If the new Normal Template is saved during the Word session, there may already be a file of the same name in the folder in which Word saves the Template. Just as with Word 2003, this can happen in two, slightly, different scenarios. In either of these cases Word will prompt for permission to overwrite and, if denied, will throw a SaveAs Dialog for the user to save it under another name and/or in another location.
If the new Normal Template is saved on exit from Word (by default, or, if the option to prompt is in effect, by responding positively to the prompt), there may already be a file of the same name in the folder in which Word saves the Template. In this event, unlike saving during the Word session, however, Word 2007 will not prompt for permission, and it will just, silently and unceremoniously, overwrite any existing file of the same name in the same location.
If a file is found and it has one of the new extensions (".docx", ".docm", ".dotx", or ".dotm"), and it passes the validation just described, but it is not a valid Template, it is not – cannot be – used and Word creates a new Normal Template based on its built-in defaults, after which the behaviour on saving is as described above.
If a file is found and it has an extension other than one of the new ones (as listed above), and it is not a valid Template, Word may prompt for an encoding to use to read the file, or it may simply fail to open it, and not report the error at all. In either case, again, Word will then create a new Normal Template based on its built-in defaults, just as it would had it issued an error message, after which, again, the behaviour on saving is as described above.
If a file is not found, and an extension has been specified in the registry entry (even an explicit ".dotm"), Word will create a new Normal Template based on its built-in defaults, again, as described above.
If a file is not found, and the extension defaults, in other words no extension is specified in the registry value, Word 2007 will search each of its locations in turn again, looking, this time, for a file with the same name as specified or defaulted, but with a ".dot" extension instead of the ".dotm".
If it is the first time Word 2007 has been run since it was installed, and a ".dot" file is found, and the registry entry either contains an absolute path, or does not contain a path at all, Word will not use the file, but it will rename it. Provided there is not already a file with the new name already existing in the same folder, Word will rename the file by adding "11" to the name (OldStuff.dot, for example, will be renamed as OldStuff11.dot).
In all other cases, if one is found, and also in the case where the renaming described above has failed, and the file is a valid template of any sort (97-2003 format, 2007 format, or 2007 macro-enabled format) Word will create a new Normal Template based on the (presumed) old one. The behaviour on saving this new template is as previously described.
If a file is not found, Word will create a new Normal Template based on its built-in defaults, just as described above.
Microsoft are very concerned about user safety and security, and have, over the years made many changes to try to protect users from malware and the like. In Office in general, and Word in particular, they have moved towards preventing macros from running without users’ explicit knowledge and consent. The options and mechanisms have changed over time, and Word 2007 saw changes that could affect your Normal Template. The circumstances that cause problems are limited and relatively unusual, so this is just a brief overview.
By Word 2007 the notion of Trust included Trusted Locations, and the Macro Security options, as presented in the UI, had been simplified. The user could ignore Microsoft’s recommendation and enable all macros, or there were three options for different levels of disabling macros in documents or templates not in trusted locations: disable all, disable all except signed, or disable all with warning. Enabling all macros was not, in most circumstances, wise, but, if chosen, all that I have written so far would hold true. If all, or all except signed, were disabled, again, all I have written would hold true.
When you use the option to disable macros (in non‑trusted locations) with warning, and you open a document or template containing macros, Word 2007 does not actually disable macros, or stop them running. What Word 2007 does is to load the document or template as normal except that, instead of loading its VBA project, it creates a new, dummy, VBA project that can be used in the session but which will not be saved. There is no possibility of any payload doing anything untoward, because it has simply been left on the shelf, as it were. A ‘Security Warning’ is displayed on the message bar under the Ribbon, along with a button, labeled “Options”; clicking on the button brings up a Dialog from which you can decide what to do. If you choose to enable the macros, Word will then load the real VBA Project in place of its dummy one. Exactly how it does this is, as you probably expect by now, not entirely straightforward.
If the document or template containing the macros you are enabling, has not been changed, Word just loads the VBA project that belongs with it. If, however, the document or template has been changed, Word saves the changes made to the document or template itself, but not those made to the dummy VBA project, before re‑loading the entire document, this time with its VBA project. This difference in behaviour is significant if the macros you are enabling are in your Normal Template because Word makes a mistake.
As you have seen above, Word 2007 demonstrates a variety of different behaviours, in a variety of very specific sets of circumstances, and adding trust to the equation just introduces another level of complexity. Most of the situations described above are very unlikely, and have been presented only for the sake of completeness. I do not propose to detail all the complications that can arise in all possible circumstances involving untrusted locations, but there is one situation that you might find, perhaps even create unintentionally, and that, very specific, situation is what is described here.
If you start Word with a Normal Template – an ordinary macro‑enabled Word 2007 format template with a .dotm extension – in an untrusted location (and that location is different from your User Templates location) and, before making any changes to the Normal Template, you enable macros via the Dialog, then Word 2007 will try to load the VBA Project from a file with the same name as your Normal Template but in the User Templates location. If you don’t have such a file, you will get an error message and your macros will not be available to you, but if you do happen to have such a file, Word will load the VBA Project from it alongside the dummy VBA project it has already created. Word will then have two VBA Projects, both purporting to belong to your Normal Template, one dummy one and one from a file on disk that is not your Normal Template.
Changes you make to your VBA project will never be saved where you want them, but Word does know exactly what it is dealing with, and will offer to save any changes to the real VBA project (of the wrong file), but not any made to the dummy one. When you close Word it will either save your Normal Template automatically, or prompt you about it if you have the relevant option set, but it will not save any VBA to the same file. If you have made changes to the VBA project, Word will prompt you separately for permission to save the file, as it would with any other document or template you had open. The file it is prompting about, which is not immediately obvious from the text of the prompt, and the one to which it will save the VBA project, is the file in the User Templates location from which it loaded the VBA project; it will not make any changes to the rest of this file, just the VBA project.
Provided you know what is going on, everything does work and could be considered consistent, but I can’t think of any reason anyone would want this behaviour. Nor, indeed, can I think of any behaviour that Word exhibits in any circumstances where the Normal Template is not in a trusted location, to be useful. Word expects you to trust your Normal Template, despite the fact that it can, all it by itself, on occasion, cause that not to be the case.
As far as I can tell, Word 2010 behaves in exactly the same way as Word 2007, with a single exception. In the case where Word 2007 renames an old ".dot" file by adding "11" to the name, Word 2010 renames by adding "old" to the name instead of "11".
Prior to Office 2007, if you used Word as your Outlook editor, the instance of Word that ran inside Outlook was the same as any other instance of Word that you ran, and it shared Word’s Normal Template. This sharing did cause some problems and, partly as a way of overcoming those problems, Office 2007 introduced a new mechanism.
In Outlook 2007 it is no longer optional to use Word as your editor – it is compulsory. Outlook 2007 ships with a limited-functionality copy of Word just for use in Outlook, sufficient for normal use in Outlook, which gains some extra features if you also have the full version of Word installed. The instance of the version of Word that runs in Outlook 2007 (and Outlook 2010) is separate from any other instance of Word you run. Separate settings are maintained, both in the registry and in the Normal Template, and the Normal Template used in Outlook is, by default, called "NormalEmail.dotm".
The version of Word that runs in Outlook, however, is still Word and it works in, essentially, the same way as any other version of Word, and this similarity extends to giving you the option to override the default name of the Normal Template. The name is held in the same registry key as, and works in the same way as, the name of Word’s ordinary Normal Template. For the Word Editor in Outlook, the registry Value is called GlobalEmailDotName.
Well, yes, and no! You might think that if you set up the registry entries, GlobalDotName and GlobalEmailDotName, so that they were both the same that you could make Word and Outlook share the same Normal Template. Things, of course, are never as simple as one would like them to be, but you can make it work most of the time.
I mentioned earlier that Word will open a shared Normal Template in Read-Only mode, and this is true, but it doesn't really tell you anything very much about what happens. Word requires a Normal Template exclusively for its own use and will ensure that it gets one. If the Normal Template it wants to open is already in use in another Word session, Word will take a copy of the latest saved version and open that copy in Read-Only mode.
Briefly, for it is not the matter at hand, and as you know, when Word opens a Document you sometimes get a message that the document is locked for editing, something like this:
Word’s prompt when a Document is already in use
This prompt may, or may not, tell you who, Word thinks, has locked the file, but it does always inform you of (what it thinks is) the situation and allows you to make a choice.
When Word opens a Document it will determine, according to a clear set of rules, the Template to which to attach it and will, if necessary, open that Template. When Word opens a Template in this way, just as when it opens a Document, it checks to see if that Template is already in use elsewhere. In this case, however, if the Template is open in another instance of Word, you are not prompted: Word just automatically opens the Template in Read Only mode, or, more precisely, it opens a copy of the Template in Read-Only mode.
If you make changes to a Template that has been opened in Read Only mode, and try to save those changes, it is at that point that Word will prompt you. If the Template is still open elsewhere, Word will tell you:
Word’s prompt when a Template is in use
When you acknowledge the prompt, Word will show a SaveAs dialog for you to save the Template somewhere else, or to give it a different name. If the Template is no longer open elsewhere, Word recognises this but does not know whether any changes have been made to it by any other instance of Word. In this case, it prompts you slightly differently:
Word’s prompt when a Template may have been changed
The effect is the same: Word has done its best to warn you of potential problems and you have taken whatever action you deemed suitable.
When Word opens its Normal Template, it does exactly the same as when it opens a Template to attach to a Document, that is, it automatically opens a copy of it in Read-Only mode if it is open in another session of Word and only warns you when you attempt to save changes made to it.
If you try to use the same Normal Template for both Word and Outlook 2007 (or 2010), what happens depends on which application you start first, because that session of Word is the one that, in effect, holds the master copy of the Normal Template.
If, as many people do, one of the first things you do in the morning is to start Outlook to check your e-mail, then Outlook will open your Normal Template and apply a lock on it. When you then start Word, it will find the lock and open a copy of the Normal Template for itself in Read Only mode. If you close Word while Outlook is still running you will get the first of the two prompts above, and be unable to save your amended Normal Template over the top of the existing one. If you close Outlook first, and then try to save your Normal Template in Word, you will get the second of the prompts above, and you will be able to save, but only at the cost of overwriting any changes you made to the Normal Template in Outlook. As you are much more likely to make changes in Word than in Outlook, you can probably get away with losing the changes made in Outlook, but this is not a good way to work.
If, on the other hand, you start Word first, before you start Outlook, then it will be Word that opens your Normal Template and applies the lock on it, and Outlook that opens the Read-Only copy. Once Outlook has a Read-Only copy, it has it for the duration of the session; it doesn't make any attempt to lock the template when it becomes free, so you are free to open and close Word as often as you like afterwards. When you close and re-open Outlook, it will pick up the latest version you saved in Word and, provided Word is open at the time, Outlook will only pick up another copy.
In summary, if you wish be able to ‘share’ the Normal Template and to gain access, in Outlook, to changes made in Word, you might very well be prepared to accept the constraints: that you open Word before you open Outlook, that you don't make changes in Outlook that you wish to save, and that you must save the Normal Template in Word and close and re-open Outlook (while keeping Word open) in order for Outlook to gain immediate access to any changes. Only you can really know, but, for most people in most circumstances it should be a satisfactory work-around.
One could probably write a book about the Normal Template but my intent here was simply to cover how Word finds it and, thus, how you could find yours. I have already written far too much and this final section is tying up loose ends, as it were; I simply note the following:
Word will always show the first letter of the name of the Normal Template file in upper case in the VBE, regardless of the actual filename.
Many dialogs that refer to the Normal Template, for example the Macros dialog, the Organizer dialog and the Record Macro dialog, refer to it explicitly as "All Documents (Normal.dotm)", or "Normal.dotm (global template)", regardless of what the file is called. Some other dialogs, such as the Templates and Add-Ins dialog, and the Create New Building Block dialog seem to refer to it correctly by its name.
There appear to be one or two oddities enabling macros when the Normal Template is not in a trusted location. I will dig a little deeper and expand the article where appropriate. I have now added a little on this: see the section headed “Trust” under Word 2007, above.
Word has a concept of a ‘primary editing language’; information on what this means is very sketchy but, supposedly, it is used to determine default values for some features. It affects, for example, some toolbars, default fonts, sort sequences, bullets and numbering, and, as I found out recently, the language used in date formats in Word Fields. I may write more on this another time, but, for the moment, I simply note that, if you change your primary editing language, the next time you start Word, it will rename your existing Normal Template by adding an extension of ".old" to it ("Normal.dotm", for example, becoming "Normal.dotm.old"), and then create a new Normal Template from its built-in defaults. If you already have a file called "Normal.dotm.old" (or whatever name Word is trying to use, which, as you now know, depends on what you have told Word), it will be unceremoniously overwritten.
Well, yes, of course, but that’s enough, if not too much, for now. Well done for reading this far; you may now resume your normal life.