如何检查是否安装了 Microsoft Office?
如何检查 Microsoft Office 是否是使用 C# 安装的?
Possible Duplicate:
C#: How to know whether certain Office 2003 or 2007 application is installed?
How can I check if Microsoft Office is installed using C#?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您不需要特定的 Office 版本,您可以通过查找 Office 应用程序之一的应用程序路径(例如 winword.exe)进行检查:
If you don't need a specific Office version present, you can check by looking up the App Path to one of the office apps (winword.exe for instance):
您可以在注册表中查找:-
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\nn.n\Word\InstallRoot
nn.n 将是安装的版本 11.0 或 12.00
You could root around in the registry:-
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\nn.n\Word\InstallRoot
The nn.n will be the version installed 11.0 or 12.00
尝试创建包含版本的对象,如果抛出错误,则很明显您正在寻找的 MSOffice 尚未安装。
尝试如下所示的操作
因为所有客户端都不会授予您读取注册表的权限
try to create the object with the version in it and if it throws out error, it is evident that the MSOffice you are looking for is not installed.
Try some thing like the below
Because all the clients would not give you the permission to read the registry