johnnyshieh

下面是一段 把HTML 页面的内容导入到WOrd 的代码,在网上找的,谁能给解释一下。

 <div id="Layer1">
<input type=button name=\'button_export\'   onclick=OpenWord() value=用word打开 id="Button1"></div>

<script language="javascript">
function OpenWord(){
Layer1.style.border=0
ExcelSheet = new ActiveXObject(\'Word.Application\');
ExcelSheet.Application.Visible = true;
var mydoc=ExcelSheet.Documents.Add(\'\',0,1);
myRange =mydoc.Range(0,1)
var sel=Layer1.document.body.createTextRange()
sel.select()
Layer1.document.execCommand(\'Copy\')
sel.moveEnd(\'character\')
myRange.Paste();
location.reload()
ExcelSheet.ActiveWindow.ActivePane.View.Type=9
}
</script>

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-12-19
  • 2021-11-24
  • 2021-12-09
  • 2022-02-09
猜你喜欢
  • 2021-12-09
  • 2021-12-05
  • 2021-11-16
  • 2021-08-27
  • 2022-01-18
  • 2021-12-09
  • 2021-12-09
相关资源
相似解决方案