如何将网页文件导出到word中

时间:2021-11-03 06:22:03

<script language="javascript">
function OpenWord(){
Layer1.style.border=0
word = new ActiveXObject('Word.Application');
word.Application.Visible = true;
var mydoc=word.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()
word.ActiveWindow.ActivePane.View.Type=9
}
</script>

 加入这段代码可将网页上的内容直接导出到word

<input type=button name='button_export' title='导出到word' onclick="OpenWord()" value="导出到word">

相关文章