function AllAreaWord(tableid){
var p = document.getElementById(tableid);
var oWD = new ActiveXObject("Word.Application");
var oDC = oWD.Documents.Add("",0,1);
var oRange =oDC.Range(0,1);
var sel = document.body.createTextRange();
sel.moveToElementText(p);
sel.select();
sel.execCommand("Copy");
oRange.Paste();
var selection = oWD.Selection;
selection.Find.Text = "我";
oWD.ActiveDocument.ActiveWindow.View.Type=3; //设定显示为页面视图状态
oWD.Application.Visible = true;
//window.close();
}
js代码