Home > Backend Development > C++ > How Can I Programmatically Detect Installed Microsoft Office Versions?

How Can I Programmatically Detect Installed Microsoft Office Versions?

DDD
Release: 2025-01-11 16:14:42
Original
279 people have browsed it

How Can I Programmatically Detect Installed Microsoft Office Versions?

Identifying Installed Microsoft Office Versions: A Practical Guide

Overview

Knowing the installed Microsoft Office versions, particularly Excel versions, is crucial for various applications. This guide provides a reliable method for detecting these versions.

Methodology:

A dependable approach involves examining the InstallRoot Registry keys.

Registry Key Locations:

Each Office application maintains a unique registry key indicating the executable's location:

  • Word: HKLM\Software\Microsoft\Office\Version\Word\InstallRoot::Path
  • Excel: HKLM\Software\Microsoft\Office\Version\Excel\InstallRoot::Path
  • PowerPoint: HKLM\Software\Microsoft\Office\Version\PowerPoint\InstallRoot::Path

Version Number Mapping:

Substitute "Version" with the corresponding version number:

Microsoft Office Version Registry Version Number
97 7.0
98 8.0
2000 9.0
XP 10.0
2003 11.0
2007 12.0
2010 14.0
2013 15.0
2016 16.0
2019 16.0

Special Considerations for Office 2019 and Office 365:

The Click-To-Run installation method used by Office 2019 and subsequent versions alters the registry structure. Version numbers are not consistently present in registry keys. While the file version of winword.exe might offer a clue, this can be unreliable as it also increments with patches applied to older Office 2016 installations.

Summary:

By inspecting the InstallRoot Registry keys and using the appropriate version numbers, you can effectively determine installed Microsoft Office versions, including specific Excel installations. However, be aware of the limitations when dealing with Click-To-Run installations of Office 2019 and Office 365.

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template