Southern said:
I have a Word template to share with others. I repeatedly have to
explain how they need to put it in their template folder before using
it. Is there a simple way to create an .exe file that all it does
check to see what the MS Word uses as the tempate folder and copys my
template into it?
thanks.
ck
Easy? No, that would be far too simple for anything named Microsoft. ;-)
The first step is to look in the registry at the key
HKEY_CLASSES_ROOT\Word.Document.8\shell\Open\command
The value of the (Default) item contains the path to the copy of WinWord.exe
that opens a document when you launch it from Windows Explorer. That path
contains the version number of that copy of Word; for example,
"C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE"
tells you that version 11 (that is, Word 2003) is the target.
The next step is to look in the registry at the key
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\General
or the equivalent for whatever version of Office is being targeted. If the
key contains an item named UserTemplates, then the user has customized the
location of the User Templates folder to be different from the installation
default, and the value of the item is the folder where you should install
your template.
If there is no UserTemplates item in the key, then Word is using the
installation default. Unfortunately, that varies by Office version and
Windows version. For recent versions of Word on 32-bit Windows XP, it will
be
C:\Documents and Settings\<user name>\Application Data\Microsoft\Templates
It will be slightly different for 64-bit Windows and for Vista. If you can
expand environment strings in your program, it may be easier to look for
%appdata%\Microsoft\Templates
which should work in any Windows version.
Once you have a working installation program, try to test it on every
combination of Word version, Windows version, and customization vs. defaults
that you can find.
--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.