Home >Backend Development >C++ >How Can I Determine the Installed Versions of Microsoft Office?

How Can I Determine the Installed Versions of Microsoft Office?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2025-01-11 15:57:43614browse

How Can I Determine the Installed Versions of Microsoft Office?

How to detect installed MS Office version

Question:

Determining the installed version of Microsoft Office is critical for software requirements verification and specific feature availability. Additionally, identifying multiple installed versions and their specific versions increases the complexity of the challenge.

Solution:

1. Check the registry key:

One effective method is to check the InstallRoot registry key of the relevant Office application. For example, checking for the presence of the following key indicates that Word 2007 is installed:

<code>HKLM\Software\Microsoft\Office.0\Word\InstallRoot::Path</code>

Replace "12.0" with the appropriate version number to check for other Office versions.

2. Use MSIEnumProducts API:

Alternatively, you may consider using the MSIEnumProducts API to query the MSI database. This method provides a complete list of installed MSI products, including their versions.

3. Check file version:

For side-by-side installations of different Office versions (not officially supported by Microsoft), you can compare file versions of the main Office application (such as WINWORD.EXE). If the version is greater than 16.0.10730.20102, it means Office 2019 or the current Office 365 version.

Instructions for Office 2019 and Office 365:

Starting with Office 2019, MSI-based installers have been discontinued, leaving Click-to-Run as the only deployment method. Therefore, major/minor version numbers are no longer updated. As a result, Office 2016 and Office 2019 have the same version number (16.0) in the registry key.

The above is the detailed content of How Can I Determine the Installed Versions of Microsoft Office?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn