Phantom Templates In Word 2003

I cannot remember how I did this in WORD 2003 in the past. but I know that I did it.

The "new" document from templates dialogue has tabs and template names that I cannot delete (e.g. Legal Pleadings, Faxes, Reports etc). I sometimes get the option to "Click OK to install additional templates and create a new file" in the preview window. I've searched for a location for these files and deleted what I could find.

I want to use my own tabs to categorise my templates and get rid of the above. I have had partial success by setting the template file location in Options to ....
W:\DATA\WORD\Templates         I have created various subfolders such as.....


The above Sales & Quotations do appear at tabs once there is something in them, but I still cannot get rid of the phantom folders & templates.
LVL 24
EirmanChief Operations ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Raymond PengSystems EngineerCommented:
Can you right click on the icon and select delete?  Under tools > templates / addins, what happens when you uncheck those, do you have the option to delete?
EirmanChief Operations ManagerAuthor Commented:
> Can you right click on the icon and select delete?
No joy there .... It was one of the first thing I had tried

> Under tools > templates / addins, what happens when you uncheck those, do you have the option to delete?
No joy there either! Unchecking and/or removing makes no difference. Besides, they all come back after restarting word.

I'm going to look more deeply into this later when I have a chance, but I think that the tabs in the dialog you are referring to are hard-coded into one of the Office Resource DLLs that is shared by more than one of the Office 2003 applications.

C:\Program Files\Common Files\Microsoft Shared\OFFICE11\1033\MSOINTL.DLL

A DLL is a library of functions, registry settings, layout files, bitmap and other images, icons, menus, dialogs, text strings, etc, etc.  These resources are "called out" from within a DLL by the requesting application as needed.

Using a little program that can display some of the resources inside this DLL I can see the following text, and have highlighted the relevant parts:
.Here is the actual dialog resource inside that same "MSOINTL.DLL" file:
.And, for comparison purposes, here is a screenshot of the actual dialog being opened from within MS-Word 2003 (File > New > In "New Document" pane click link for "My Computer ..."):
Based on this finding, I do not think you will be able to remove any of the default tabs from that dialog without decompiling the relevant Shared DLL, modifying it in a programming suite (Visual C++ ?) and recompiling it with the hope that it works.  That's against licensing and beyond my level of knowledge.

Just how MS Office knows where to place the different types of templates is something I am not immediately sure of, but will try to find out.

Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

EirmanChief Operations ManagerAuthor Commented:
Thanks Bill, Great information! I'm looking forward to your final findings.

I think there is a workaround which I'll try later. If you create enough template folders starting with a 'high' alphabetic character, it will push the phantom "hard-coded" folders out of sight. The new template folders cannot be empty if you want them to be visible.
Interesting workaround.  I'll need to experiment a bit.  Being honest, I don't use many templates and only ever install a few, so I haven't encountered this issue before.

I did confirm that the names of the default tabs are shown from the resources in "MSOINTL.DLL", and did so (after backing up the file) by modifying those names in a Hex Editor.  I had to try and think up names with the same number of characters and make them unusual enough to find quickly in the hex editor again, so hopefully you will excuse the puerile humour:
Notice how the "General" and "Mail merge" tabs remain unmodified.New Tab Text = Original Tab Text
Captain = General (See Notes)
Canines & Foxes = Letters & Faxes
Dumb & Dumber 02 = Design Templates
(Mail Merge - See Notes)
Memes = Memos
Misc. Documents = Other Documents
Porky Pig Pig = Presentation Databases
Purification = Publications
Refarts = Reports
Trash Documents = Legal Pleadings

Changed in Hex Editor but not reflected in dialog:
Bad Trash = Web Pages (I have FrontPage 2003 installed separately, perhaps this is why)
Exorcists = Databases (Because I don't have Access installed)
*Primitive* Ablutions = Spreadsheet Solutions (I don't have any of these wizards installed)

Even though I named the "General" tab to "Captain" in the place where all the other tab names are in the Hex Editor, it remains unchanged in the dialog.  I could not find a "Mail Merge" in the Hex Editor amongst the other tab names.

While checking out something else in my Registry concerning the {GUID} of an installed application, I ended up looking at that of my MS-Office Professional 2003.  I can see all the {GUID} numbers given to the various components installed by my version of Office, and these include default folders and template files.  They each have their own unique number, and I am wondering if, rather than having some metadata in the files themselves used for identification:
The properties of one of the default templatesthese registry entries are actually what dictate which tab in the "New Office Document" dialog these different template files show.

Perhaps this goes way deeper than what you need, however I'm quite intrigued and maybe you will find whatever I discover of interest rather than immediately useful.

I'll be back later with more info.
EirmanChief Operations ManagerAuthor Commented:
The best I could do by adding sub folders to the templates file path was to clear the top line of tabs in the dialogue. The spurious tabs were moved to the bottom row. Creating any more, just created a new tab called "more..." which contains links to every tab except General.

The 'General' tab seems to be special. The and templates that I created, reside in W:\DATA\WORD\Templates. In options, this is the file path for 'user templates'

My results
I had some mis-information in my question, I stated that I had achieved my objective in the past, but I couldn't remember how. That was back in 2000, so I must have been using word97.
EirmanChief Operations ManagerAuthor Commented:
ALL GONE ... and not a hex editor in sight !!!

2010 Success
Actually, I networked in from another PC with word 2010 to the same folder structure .... and lo and behold .... perfect results in Word 2010.

This question is a legacy issue for a customer with w2003. Maybe I can persuade him to upgrade.

I think the word 2003 programming team were just trying to show their programming prowess to their bosses !!!

ps - EE have screwed up. They seem to have tried to reintroduced the expert skin, but thrown out the baby!
Hi Eirman

I was curious about your Time Zone which indicated you were up and about during my daytime also, so I looked at your profile and then your website.  You probably know a great deal more than I do about MS-Office applications in general terms, although perhaps you haven't been inclined to "tinker" as much as I have, which makes me a "Jack of some trades, and Master in some" ;-)

You were correct in your memory of how previous versions of MS-Office/Windows stored templates.  It was simply a matter of deleting folders as discussed in this previously asked question that I just found:

I discovered this and then verified from the accepted comment in the above question.  I am sure that it would work, but have not pursued it because I may have a better suggestion. The registry deletion is too much of a hack to make it the "best" option.

Things are a bit confused on the computer I am using because I installed Office 2003 Pro using a Transform created with the Office 2003 Custom Installation Wizard, and then installed FrontPage 2003 using another *.MST file.  To compound things, I have since done a bit of jiggery-pokery by uninstalling or adding some of the "optional Office components", and also installed the odd additional "Template Pack".  So this computer could well have a lot of Templates in different places.  It has been configured for multiple user profiles but is a standalone home computer.  So, whatever I might try may not be echoed on your client's computer(s).

First some relevant links that I discovered after having a "Eureka" moment with the suggestion that follows:

About Document Template Locations (Word 2003)
About Templates In Word 2003
Office 2002 On Different Windows Versions

When you use the Add/Remove Programs item for the Office suite and go into "Maintenance Mode", it checks the registry to verify which components are installed and know where to extract the relevant files from, and where to install them to, if you choose to add optional components.
The last screenshot in the attached PDF file shows the example of uninstalling the "Memos" component from the Microsoft Office Word > Wizards and Templates section.

This SHOULD also remove the "Memos" tab from the New Office Document dialog, because it will have removed references to that component in the registry and will have removed the files that would have populated that tab previously.

You aren't necessarily wanting to remove the template files though, so would really have to preserve them by moving them to sub-folders in the new Templates folder prior to using the Add/Remove Programs.

I would suggest that this is the best method, but I am not sure if this could be automated if performing it on many computers.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
EirmanChief Operations ManagerAuthor Commented:
Your Eureka inspiration moment certainly pulled the solution from hat. Many thanks Bill
All it needed was the add/remove features in office setup .... so obvious ..... why didn't I think of it ..... so quick and easy when you know how.
Thanks again.
Thank you ModernMatt and Eirman.

Hope you don't mind if I just "round up" what I discovered about the process of displaying the different template files under their respective tabs in the "New Office Document" dialog.

I am not going to list a bunch of Registry keys, and I may not use the correct programming terminology for certain descriptions, because I am not a programmer and this is intended only as a summation of what I discovered using a Process Monitor and looking at the resources of some of the files.  It's probably all shown somewhere on the Microsoft site, but most likely in language I don't understand.  I'm discussing this in context with Windows XP.  Windows 2000 may be similar in some respects as may be later Windows versions, but I have not checked.

OSA.EXE is the "New Office Document" program, launched with the -n switch.
As it launches, it does a huge amount of cross-referencing with the registry, the directories commonly used for templates, and also the cached install source (C:\MSOCache).

The way it works is that the *.MSI installer file that was used to install Office 2003 has stored within its tables the "Product ID" number of the Office Suite,  a "Component ID" for each separate file, folder, or category of file, and loads of other unique identifiers.  The Component ID also has a unique name assigned to it.  The *.MST file used to customise the original setup stores the information about what features and components were installed and which were not.

The Windows Installer creates the usual registry keys to allow for uninstallation, but because there are so many "Optional Components" that may later be removed or added (Sometimes added courtesy of the "Install on First Use" functionality of such applications), it is useful for the original *.CAB files, *.MSI file (installer package), and *.MST file ("Transform" file user to customise the setup) to be stored as a local setup source or on a network drive rather than the CD being prompted for each time.

Just about every file installed by Windows or from a fully compliant "Windows Installer" file is tracked by a unique number stored in the registry, whether it is a long hyphenated "Product ID" in {GUID} format, a long "Component ID" with no hyphens, or a rehash of one or other of these.

Windows uses an odd trick where it takes a {GUID}, breaks it up into chunks or bytes, then reverses either the entire chunk or individual byte.  An example is the {ProductID} code for Office 2003 Pro:
It is broken up like this:
90110409  6000  11D3  8C  FE  01  50  04  83  83  C9
and then rehashed into this:
90401109  0006  3D11  C8  EF  10  05  40  38  38  9C
which ends up as this:

Example, the "PackageCode" Value used in the registry for the Office 2003 *.MSI file:
283E2016 B531 1624 AB 76 6F 0FB9 A6 46 38
is re-ordered from this GUID stored in the MSI Package:

This complicates things greatly when trying to track what is happening, but there must be a good reason for using this method.

The file:
C:\Program Files\Common Files\Microsoft Shared\OFFICE11\1033\MSOINTL.DLL
stores the resources to display the "New Office Document" dialog.  as shown in my earlier comment, the names of the Template Groups are hard-coded into this file.  I demonstrated that the names can be changed by tinkering with the file's resources in a Hex Editor without affecting the functionality.  The different categories of templates still show in the renamed tabs.

The names for the tabs are:
Letters, Faxes, Memos, Reports, Web Pages, Design Templates, Presentations, Databases, Publications, Spreadsheet Solutions, Other Documents, General, and Legal Pleadings,
but not all of them will show at one time.  It depends on what applications are installed and also what optional components are installed for those applications.

Take for example the PowerPoint related tab names of "Presentations" and "Design Templates".

The "New" dialog will differ when you use the "New Office Document" Start Menu shortcut or if you first open PowerPoint then click File menu > New, and choose the "From My Computer" link in the "Task Pane".  With the former, it shows all the template tabs for other applications' templates, whereas the latter only shows PowerPoint templates, however the same PowerPoint tabs are present in both and are populated by the same file icons.

The ones under the "Design Templates" tab are the empty "themed" templates for various purposes where you have to choose a layout, while the ones under the "Presentations" tab are already populated with slides containing content typical for the purpose in hand (eg. "Brainstorming Session") that you adapt to suit.

If you relate this to the Optional Components for PowerPoint if you run the "Maintenance Mode" installer illustrated in my PDF file attached to the previous comment, the tab names refer to the respective components like this:
.Design Templates (Typical and Additional) component = "Design Templates" tab
Content Templates (Typical and Additional) component = "Presentations" tab.

If you were to look at the names assigned to the "Component ID" numbers in the Installer Package, you would see these:

Each one of these categories is assigned a separate Component ID number that is stored in the Registry and in the Installer Package (or perhaps a reversed "hash" thereof).

If you download a Microsoft "Templates Pack", it should already know these category names and Component ID numbers, install them to the correct folder, and update the registry accordingly so that they will show under the correct tab in the dialog.

Here is an example of a "Component ID" stored in the registry:
This will have a very long list of values like this:
(The "Brainstorming Session" template I mentioned above)
Amongst the gobbledegook DataValue you can see a name, which in this case is "PPTContentFilesAdditional"

The "1033" value is (I believe) the language code and I think this value relates to the folder at:
C:\Program Files\Microsoft Office\Templates\1033
where this particular template is stored as "Brainstorming Session.pot".  Why the file name differs from that in the registry (brain_s.pot) is something I have not figured out.  Perhaps I installed an additional template pack that updated the template files with intuitively named ones.

Some of the keys under [HKEY_CLASSES_ROOT\Installer\Components] that contain MS-Office template related values will only contain one value, while others such as the key above contain loads of values, but the important thing is the identifier in the data value (eg. the "PPTContentFilesAdditional").  I believe that this is how the "New Office Document" dialog knows what to display under each of the tabs.

When you open the "New Office Document" dialog (OSA.EXE) it obviously calls out resources from "MSOINTL.DLL" and then queries directories and registry entries using function calls through the most appropriate DLL files, for example "MSI.DLL" to query an installer package and cross-reference it to a Windows Installer registry entry.

Quite early on it queries the "Places" value in the key:
so that it knows the last used tab and opens to that.  For example, the value could be:
"Place="Mail Merge"

Because MS-Office can be installed so that it is only available to the user installing it or to every user of that computer, the "Current User" related keys are queried along with the "Local Machine" and "All User" keys, but essentially it is doing the same in all and that is checking the installed Optional Components for Microsoft Office so that it knows what tabs to show and then which templates to display under the respective tabs in the dialog.  In the event that more than one office suite is installed, the registry check looks to see how many different OSA.EXE files exist and what "Product Code" each refers to.  In my case I installed MS Office 2003 Pro from one CD and FrontPage 2003 from another CD containing a different edition of Office 2003, so I have two OSA.EXE files showing in the registry with the Product ode for each version of Office against it.

OSA.EXE does ascertain from the registry where the local cache of original installation files are, but I'm not sure if it is verifying the installed Optional Components or just getting ready to show a path if an error occurs.

It eventually gets to this key in my registry:

This has "Features" and "Usage" sub-keys which respectively store details about what optional Office components are available, and which are installed.  For example the following ones of relevance to the question:

PubWizardsXxxxxx (loads of separate category names)
XDocsSolutionXxxxXxxx (loads of these separate category names)

Note those names, because that is how the names of the template files are referenced in the registry and I believe is also how the dialog knows which tab to show them under.

When it comes to uninstalling these templates in Maintenance Mode Setup it will delete the "Component ID" key for that category of optional components and flag it as unavailable, and so the New Office Document knows not to try and load that tab even though it has the internal resource to do so.

I'm guessing here, but if I made copies of all the PowerPoint Template files in:
C:\Program Files\Microsoft Office\Templates\1033
then entered the Maintenance Mode setup and uninstalled all templates, I suspect that the PowerPoint related templates tabs would not show even if I then moved all the copied template files back into that folder.

That, I think, is the reasoning offered in a linked page from my earlier comment where the suggestion is to locate the "Component ID" key for the relevant template category in the registry and just delete it.  Doing it properly by uninstalling that Optional Component grouping is a better way of doing this.

There are a couple of odd-ball template icons that show in the "General" tab, and it is notable that these oddities do not have a Right-Click > Properties function.  I think these are just "NameSpaces" that simply run the respective applications with the relevant command line switches to create a blank presentation.

Well, I was interested enough to look into this for my own satisfaction and curiosity, and it was a shame to just keep it to myself.  Hopefully you or someone else happening into this question will find it interesting.  It wasn't intended to point anybody to specific registry keys, so as I said at the start this is just a summation.

Bye for now.
EirmanChief Operations ManagerAuthor Commented:
Quite an epilogue Bill, thanks.
You should consider the writing of an EE article based on this question.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.