C# 如何检查机器上安装的 MS Office 版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/896645/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 22:02:31  来源:igfitidea点击:

how to check MS office version installed on the machines

c#ms-office

提问by Kapil

I am working on a console app which perform some operation on registry. I am not using any interop assembly for office but i need to to know office version. How to determine which version of MS office is installed on the machine using C#.

我正在开发一个控制台应用程序,它对注册表执行一些操作。我没有为 office 使用任何互操作程序集,但我需要知道 office 版本。如何使用 C# 确定计算机上安装了哪个版本的 MS Office。

采纳答案by Johnno Nolan

Search in (using the Registryclass)

搜索(使用Registry类)

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths

or

或者

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths

Version numbers are

版本号是

  • 7.0 -97
  • 8.0 - 98
  • 9.0 -2000
  • 10.0 -2002
  • 11.0 -2003
  • 12.0 -2007
  • 14.0 -2010
  • 7.0 -97
  • 8.0 - 98
  • 9.0 -2000
  • 10.0 -2002
  • 11.0 -2003
  • 12.0 -2007
  • 14.0 -2010

Here is a c# implementation

这是 ac# 实现

回答by Cyril Beschi

I had the same requirement, but I also have to find out whether office installed is 32-bit or 64-bit. I have documented my solution here:

我有同样的要求,但我还必须找出安装的 office 是 32 位还是 64 位。我在这里记录了我的解决方案:

http://cyrilbeschi.blogspot.com/2014/03/how-to-find-microsoft-office-version.html

http://cyrilbeschi.blogspot.com/2014/03/how-to-find-microsoft-office-version.html