Installing a .dotm versus a .dot

G

Gary Hillerson

I've now got two versions of a template: one with a ribbon tab for
Word 2007 (.dotm) and one with a commandbar menu for Word 2003 and
earlier.

I've decided that for ease, I'll just install both versions when
someone downloads the template.

However, one thing my installer does is create an entry in the start
menu that points to the installed template, so the user can simply
click in the start menu to start a new document based on my template.
So now I'd like to figure out where that start menu entry should point
-- to the Word 2003/earlier .dot version, or to the Word 2007 .dotm
version.

I can ask in the installer, but I'd prefer to figure it out by
querying the registry during installation. Is there a reliable
registry query I can make to determine if the user is using 2007?

thanks in advance,
gary
 
J

Jay Freedman

Look for
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word

You can step through the values 8.0 (for Word 97) through 12.0 to see
what's the latest installed version. Note that upgrades usually leave
some of the keys from previous versions, which may or may not still be
present.
 
B

Bob Buckland ?:-\)

Hi Jay,

I think the search may need to go for a more specific subkey/DWord?
That key is present even on a Win2000 system that has the Office 2007 compatability pack converters installed to use the .docx/.docm
files (although the converters don't work with .dotm templates).

=================
Look for
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word

You can step through the values 8.0 (for Word 97) through 12.0 to see
what's the latest installed version. Note that upgrades usually leave
some of the keys from previous versions, which may or may not still be
present.

--
Regards,
Jay Freedman
Microsoft Word MVP >>
--

Bob Buckland ?:)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*
 
C

Cindy M.

Hi Bob/Jay/Gary,
I think the search may need to go for a more specific subkey/DWord?
That key is present even on a Win2000 system that has the Office 2007 compatability
pack converters installed to use the .docx/.docm
files (although the converters don't work with .dotm templates).
The better place to start in the Registry is the HKCR. Look for the Word.Application
entry, where you can pick up the CurVer. And if you need to path to the exe file, the
clsid, which you can search to get that information.

Note that this isn't full-proof: if another (earlier) version of Word has registered
itself as the "default". An alternate approach would be to loop through all entries
that start with Word.Application and compare what follows. If Word 2007 is installed,
then there should be an entry with .12

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :)
 
J

Jay Freedman

Good points all. I wasn't aware of the compatibility pack's entry --
this laptop doesn't have the pack installed.

Gary, in case Cindy's instructions are a little terse for you, this is
the long version:

Under HKEY_CLASSES_ROOT, you'll find the key Word.Application\CurVer.
The unnamed (Default) entry in this key will have a value of
Word.Application.11 or Word.Application.12 or whatever. This gives you
the version of Word currently registered to handle Word documents.
This may or may not be the latest version of Word installed on the
machine.

To find the path to the Winword.exe file, get the value of the Default
entry under the Word.Application\CLSID key, which will be a GUID; and
then find the key under HKEY_CLASSES_ROOT\CLSID whose name is that
GUID, look in the LocalServer32 subkey under that, and read the
Default value to get the path.

Also under HKEY_CLASSES_ROOT, you'll find keys like
Word.Application.11 and Word.Application.12, and you can shuffle
through those to find the highest version number among them. This will
tell you the latest installed version, regardless of which is the one
currently registered.
 
G

Gary Hillerson

THANKS ALL. Everything makes sense, and I now know what to do in the
installer.

Gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top