打开ms word/excel应用程序,而无需使用activeXObject进行跨浏览器

Open ms word/excel applications without using activeXObject for cross browser

本文关键字:activeXObject 浏览器 word ms excel 应用程序 打开      更新时间:2023-09-26
var sPath = ProChild.GetProperty("File Location");  
var sMacro = ProChild.GetProperty("Excel Macro To Run");  

想要在不使用 activeXObject 的情况下修改以下代码

 if(sMacro != null && sMacro ==""){  
    var oShell = new ActiveXObject("WScript.Shell");   
    oShell.Run(sPath);

新代码,以便更好地理解

function OpenFile(){  
alert ('Work');  
//would like to modify ActiveXObject with any other object for cross-browser. 
var x = new ActiveXObject("WScript.Shell");  
x.run('winword.exe');  
}  
//Above code works only in IE. But don't want to use activeXObject. 
//Is there any possibility to open a word file in Internet Explorer 
//without using activexobject. Request for a solution.
我曾经

尝试过这个,但这实际上并不容易,有一整套功能可以提供像 Excel/Word 这样的应用程序。

最终在客户端计算机上显示 excel 或单词是一团糟,我尝试并卡在执行宏时。

据我所知,没有什么可以允许在所有浏览器中给出单词/excel,即使是AcitveX对象也不会让你使用大部分功能。

如果可能的话,尝试找到其他解决方案,我必须在网页中显示一个 PremiumCalculator excel,而不是让人们下载相同的内容,我继续在 asp.net 年创建了一个 PremiumCalculator,而不是在 Web 浏览器中显示现有工作表。