JS 내 보 내기 단어
1451 단어 지식 수집
<input type="button" onclick="javascript:MakeWord();" value=" Word">
<SCRIPT LANGUAGE="javascript">
function MakeWord()
{
var word = new ActiveXObject("Word.Application");
// var doc = word .documents.open("c:\test.doc"); //
var doc = word .Documents.Add("",0,1);//
var Range=doc.Range();
var sel = document.body.createTextRange();
sel.moveToElementText(form);// form form id, div
sel.select();
sel.execCommand("Copy");
Range.Paste();
word .Application.Visible = true;
doc .saveAs("c:\\ba.doc"); // “\\”
}
SCRIPT>