javascrip如何调用word控件,使它具有将word文档转成html的功能?
作用:将c:\下面的test.doc另存为test.htm
要求:1.IE的设置允许(或者提示)对没有标记为安全的ActiveX进行初始化和运行;2.机器上安装了Word;3.在C:\下面存在test.doc文件。
<HTML>
<HEAD>
<TITLE>WalkingPoison's Word-to-HTML sample</TITLE>
<script language=javascript>
function saveword(){
var oWordApp=new ActiveXObject("Word.Application");
var oDocument=oWordApp.Documents.Open("C:\\test.doc");
oDocument.SaveAs("C:\\test.htm", 8)
oWordApp.Quit();
}
</script>
</HEAD>
<BODY>
Click the "save" button to save the file "C:\test.doc" to "C:\test.htm":
<input type=button onclick="saveword()" value=save>
</BODY>
</HTML>
相关推荐
lupeng 2020-11-14
sjcheck 2020-11-10
nercon 2020-08-09
pythonclass 2020-07-29
玫瑰小妖 2020-07-18
WebVincent 2020-07-09
lyg0 2020-07-05
WebVincent 2020-06-16
huzijia 2020-06-16
qsdnet我想学编程 2020-06-13
pythonclass 2020-06-06
nercon 2020-06-06
gufudhn 2020-06-06
STPace 2020-06-04
HSdiana 2020-06-03
haocxy 2020-05-31
行吟阁 2020-05-30
haocxy 2020-05-28