Copier le code du code comme suit:
<!
<html xmlns = "http://www.w3.org/1999/xhtml">
<adal>
<meta http-equiv = "content-type" content = "text / html; charset = gb2312" /> />
<Title> Document non-title </TITME>
<script linguisse = "javascript">
fonction AutomateWordAutoping (Prefixion, Count)
{{
var propre = new activeXObject ("word.application");
var odc = owd.docucumes.add ();
Odc.showgrammaticalrrs = false;
Odc.showspellinger = false;
var orange = ODC.Range (0,1);
pour (i = 0; i <count; i ++)
{{
var sel = document.body.CreateExtrange ();
var tableName = prefixion + i;
var table = document.getElementByid (tableName)
Sel.movetoelementText (tableau);
sel.select ();
sel.execcommand ("copie");
Owd.selection.paste ();
owd.selection.insertban ();
}
//owd.activeocument.activewindow.view.type=3 // Définissez le mode de navigation
owd.visible = true;
};
Fonction AutomateExcel (Prefixion)
{{
var elim = document.getElementById ("AutomateExcel");
var orangeRef = document.body.createTextrange ();
OrangeF.MovetoEelementText (Eltable);
Orangef.execcommand ("copie");
essayer {
Var appexcel = new activeXObject ("Excel.Application");
} catch (e)
{{
alerte ("无法调用 Office 对象 , 请确保您的机器已安装了 Office 并已将本系统的站点名加入到 c'est-à-dire 的信任站点列表中!");
Retour;
}
Appexcel.visible = true;
Appexcel.workBooks.Add ().
Appexcel.workBooks (1) .Worksheets.item (1) .Columns ("A: A").
//AppExcel.WorkBooks (1) .Worksheets.item (1) .Columns.com.com
Appexcel = null
};
</cript>
</ head>
<body>
<input type = "Button" value = "Export to Word Automatic Paging" onClick = "AutomateWordAutoping ('Table', 5)" />
<input type = "Button" value = "Exporter vers la largeur de la colonne de contrôle Excel" Onclight = "AutomateExcel ('Table')" /> />
<div id = "AutomateExcel">
<Table class = tabp id = "Table0" CellSpacing = 0 CellPadding = 2 Align = Center Border = 1>
<tr>
<Td align = "Center"> titre 0 </td>
</tr>
<tr>
<Td align = "Center"> Contenu 0 </td>
</tr>
</ Table>
<br>
<Table class = tabp id = "Table1" CellSpacing = 0 CellPadding = 2 Align = Center Border = 1>
<tr>
<Td Align = "Center"> titre 1 </td>
</tr>
<tr>
<Td align = "Center"> Contenu 1 </td>
</tr>
</ Table>
<br/>
<Table class = tabp id = "Table2" CellSpacing = 0 CellPadding = 2 Align = Center Border = 1>
<tr>
<Td align = "Center"> titre 2 </td>
</tr>
<tr>
<Td align = "Center"> Contenu 2 </td>
</tr>
</ Table>
<br/>
<Table class = tabp id = "Table3" CellSpacing = 0 CellPadding = 2 Align = Center Border = 1>
<tr>
<Td align = "Center"> titre 3 </td>
</tr>
<tr>
<Td align = "Center"> Contenu 3 </td>
</tr>
</ Table>
<br/>
<Table class = tabp id = "Table4" CellSpacing = 0 CellPadding = 2 Align = Center Border = 1>
<tr>
<Td align = "Center"> titre 4 </td>
</tr>
<tr>
<Td align = "Center"> Contenu 4 </td>
</tr>
</ Table>
<br/>
</div>
</docy>
</html>