gpt4 book ai didi

javascript - 如何在 javascript 中检测已安装的 MS Office 版本?

转载 作者:行者123 更新时间:2023-12-01 10:48:59 24 4
gpt4 key购买 nike

我需要知道用户计算机上是否安装了 MS Office 2013 以使用特定方式打开 Office 文档以从网站进行编辑。

也许有一些特定于 Office 2013 的插件/activex?

我试图找出 Sharepoint 是如何完成这项任务的,但它太棘手了:

this.IsProtocolHandlerEnabled = function(d) {
if (IsStrNullOrEmpty(d))
return false;
if (b[d] != null)
return b[d];
if (c)
return a;
...

如果 Office 2013 可用,“a”等于“true”,否则为“false”,但我找不到更改变量“a”的位置。

最佳答案

这个方法在 chrome 中对我有用,你可能需要简化 IE 的旧副本的迭代:

var has2013=([].slice.call(navigator.plugins)
.filter(function(a){return a.name.match("Microsoft Office")})[0].name||"")
.match(2013)||false;

alert(has2013);

关于javascript - 如何在 javascript 中检测已安装的 MS Office 版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17704925/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com