Article ID: 240794 - Last Review: July 15, 2004 - Revision: 6.5 How to Determine the Path for an Office ApplicationThis article was previously published under Q240794 SUMMARY
This article includes sample code that illustrates how you can programmatically determine the installation path for a Microsoft Office application given the ProgID for that application.
MORE INFORMATION
Automation servers have a unique ProgID that you typically use to automate that server. The following list provides the ProgIDs for Office applications: Collapse this table
Note that the table above provides version-independent ProgIDs. Applications have version-dependent ProgIDs as well that you can use with the sample code provided in this article. For instance, Microsoft Excel has a version-independent ProgID "Excel.Application" and version-dependent ProgIDs such as "Excel.Application.8" and "Excel.Application.9." Given a ProgID for an out-of-process server, you can obtain its location by examining the registry. An out-of-process server has a key in the registry at: HKEY_LOCAL_MACHINE\Software\Classes\PROGID\CLSID that provides its unique CLSID (or Class ID). That CLSID then has a registry key at: HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx}\LocalServer32 where the path to the server is specified. To illustrate, if you want to determine the path for Microsoft Excel using the ProgID "Excel.Application," you would examine this key in the registry: HKEY_LOCAL_MACHINE\Software\Classes\Excel.Application\CLSID and, depending on what version of Excel is installed, you would find that the CLSID for Excel.Application is "{00020841-0000-0000-C000-000000000046}." Next, using this CLSID, you would examine the following registry key to find the path for EXCEL.EXE: HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{00020841-0000-0000-C000-000000000046}\LocalServer32 All of this can be done programmatically using the registry API functions in advapi32.dll. Sample Code
REFERENCES
For additional information, please click the article numbers below
to view the articles in the Microsoft Knowledge Base:
234788
(http://support.microsoft.com/kb/234788/EN-US/
)
How To Find the Installation Path of an Office 2000 Application
145679
(http://support.microsoft.com/kb/145679/EN-US/
)
How To Use the Registry API to Save and Retrieve Setting
APPLIES TO
| Article Translations
|
Back to the top
