detect microsoft office version using javascript

只谈情不闲聊 提交于 2021-02-08 19:38:58

问题


I have to check whether or not the client pc has MS Office 2007 installed or not.

How can I check this using javascript?


回答1:


You cannot do this from within a browser. The browser does not allow javascript access to the client computer. It would be a gaping security hole.

Microsoft gets around this by using Active X. There are other browser-to-desktop plugins that could accomplish the same thing.

Javascript, however, is a no-go.




回答2:


You can try to do this with ActiveX. Something like:

var word = new ActiveXObject("Word.Application");

and than check operation result.




回答3:


Generally, this isn't possible.
However, if the client is using Internet Explorer, and has InfoPath installed (which is part of Office), you can check the user agent for InfoPath.2. Another option is to check for MS-RTC LM , if they have the Office Live Meeting installed.
This is very limiting, but it just might work on a local intranet.




回答4:


I have done this using the following script:

try{
var oApplication=new ActiveXObject("Word.Application");
if(oApplication){
document.write(oApplication.Version);

if(oApplication.Version == "12.0")
{
document.write("office07 installed");
}

}
}
catch( ex)
{
document.write(" not installed: ");
document.write(ex.message);
}


来源:https://stackoverflow.com/questions/1700150/detect-microsoft-office-version-using-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!