Solved

Phantom Templates In Word 2003

Posted on 2012-03-22
13
488 Views
Last Modified: 2012-04-02
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.....

W:\DATA\WORD\Templates\Sales
W:\DATA\WORD\Templates\Quotations

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.
0
Comment
Question by:Eirman
  • 6
  • 4
13 Comments
 
LVL 16

Expert Comment

by:l33tf0b
ID: 37753806
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?
0
 
LVL 23

Author Comment

by:Eirman
ID: 37754092
> 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.
0
 
LVL 38

Expert Comment

by:BillDL
ID: 37780683
Eirman

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.

Bill
0
 
LVL 23

Author Comment

by:Eirman
ID: 37781455
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.
0
 
LVL 38

Expert Comment

by:BillDL
ID: 37790201
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.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 23

Author Comment

by:Eirman
ID: 37790590
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 invoice.dot and quotation.dot 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.
0
 
LVL 23

Author Comment

by:Eirman
ID: 37790719
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!
W2010.jpg
0
 
LVL 38

Accepted Solution

by:
BillDL earned 500 total points
ID: 37791633
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:
http://www.experts-exchange.com/Q_20769459.html

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.
Office-2003-Maintenance-Mode-Set.pdf
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.
0
 
LVL 23

Author Comment

by:Eirman
ID: 37791969
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.
0
 
LVL 38

Expert Comment

by:BillDL
ID: 37793332
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:
90110409-6000-11D3-8CFE-0150048383C9
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:
9040110900063D11C8EF10054038389C

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:
{6102E382-135B-4261-BA67-F6F09B6A6483}

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:
PPTContentFiles
PPTContentFilesTypical
PPTContentFilesAdditional
PPTDesignFiles
PPTDesignFilesTypical
PPTDesignFilesAdditional

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:
HKEY_CLASSES_ROOT\Installer\Components\C6BD1954B293F2C40998508A5A1ADE85
This will have a very long list of values like this:
1033\brain_s.pot
(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:
[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Osa\FileNew]
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:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\9040110900063D11C8EF10054038389C

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:

ExcelTemplatesFiles
ExcelSamplesFiles
OutlookTemplateFiles
PPTContentFiles
PPTContentFilesAdditional
PPTDesignFiles
PPTDesignFilesTypical
PPTDesignFilesAdditional
PubWizards
PubWizardsXxxxxx (loads of separate category names)
WebPublFiles
WordFaxesFiles
WordLettersFiles
WordMacrosFiles
WordReportsFiles
WordResumesFiles
WordWizardsFiles
WORDWizAndTempFiles
XDOCSFiles
XDocsSolutionAbsenceRequest
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.
Bill
0
 
LVL 23

Author Comment

by:Eirman
ID: 37795361
Quite an epilogue Bill, thanks.
You should consider the writing of an EE article based on this question.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now