Copy code code as follows:
<! Doctype HTML PUBLIC "-// W3C // DTD XHTML 1.0 Transitional // EN" http://www.w3.org/xhtml1/dtddml1-transitationAl.dtd ">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "content-type" content = "text /html; charset = gb2312" /> />
<Title> Non -Title Document </Title>
<script language = "javascript">
function automatewordAutopaging (prefixion, count)
{{
var own = New Activexobject ("Word.application");
var oDC = OWD.Documeents.add ();
ODC.ShowGrammaticalrrs = false; // Block grammar inspection
ODC.ShowSpellinger = false; // Block the spelling check
var orange = odc.range (0,1);
for (i = 0; I <count; i ++)
{{
var sel = document.body.createtextRange ();
var tablename = prefixion+i;
var table = document.GetelementByid (tableename)
SEL.MOVETOELEMENTTEXT (table);
sel.select ();
sel.execcommand ("Copy");
OWD.Selection.paSte ();
owD.Selection.insertban (); // Insert the paging character
}
//owd.activedocument.activeWindow.View.type=3 // Set the browsing mode
owd.visible = true;
};
Function Automateexcel (Prefixion)
{{
var elim = document.GetelementByid ("Automateexcel");
var orangeref = document.body.createtextrange ();
Orangef.moveToeElementtext (eltable);
Orangef.execcommand ("Copy");
try {
Var Appexcel = New Activexobject ("Excel.application");
} catch (e)
{{
alert("无法调用Office对象,请确保您的机器已安装了Office并已将本系统的站点名加入到IE的信任站点列表中!");
Return;
}
Appexcel.visible = true;
Appexcel.Workbooks.add (). Worksheets.item (1). Paste ();
Appexcel.workbooks (1) .Worksheets.item (1) .columns ("a: a").
//appexcel.Workbooks (1).Worksheets.item (1).Columns.com.com
Appexcel = null
};
</script>
</head>
<body>
<input type = "Button" value = "Export to Word automatic paging" OnClick = "AutomatewordAutopaging ('TABLE', 5)" />
<input type = "Button" value = "Export to the Excel control column width" OnClight = "Automateexcel ('Table')"/>/>
<div id = "automateexcel">
<Table class = tabp id = "table0" cellspacing = 0 cellpadding = 2 align = center border = 1>
<Tr>
<Td align = "center"> Title 0 </td>
</Tr>
<Tr>
<Td align = "center"> Content 0 </td>
</Tr>
</Table>
<br>
<Table class = tabp id = "table1" cellspacing = 0 cellpadding = 2 align = center border = 1>
<Tr>
<Td align = "center"> Title 1 </td>
</Tr>
<Tr>
<Td align = "center"> Content 1 </td>
</Tr>
</Table>
<br/>
<Table class = tabp id = "table2" cellspacing = 0 cellpadding = 2 align = center border = 1>
<Tr>
<Td align = "center"> Title 2 </td>
</Tr>
<Tr>
<Td align = "center"> Content 2 </td>
</Tr>
</Table>
<br/>
<Table class = tabp id = "table3" cellspacing = 0 cellpadding = 2 align = center border = 1>
<Tr>
<Td align = "center"> Title 3 </td>
</Tr>
<Tr>
<Td align = "center"> Content 3 </td>
</Tr>
</Table>
<br/>
<Table class = tabp id = "table4" cellspacing = 0 cellpadding = 2 align = center border = 1>
<Tr>
<Td align = "center"> Title 4 </td>
</Tr>
<Tr>
<Td align = "center"> Content 4 </td>
</Tr>
</Table>
<br/>
</div>
</body>
</html>