Kopieren Sie den Code -Code wie folgt:
<!
<html xmlns = "http://www.w3.org/1999/xhtml">
<kopf>
<meta http-äquiv = "content-type" content = "text /html; charset = gb2312" /> />
<title> Nicht -Title -Dokument </title>
<script Language = "JavaScript">
Funktion AutomateWordAutopaging (Präfixion, Anzahl)
{{{{
var Own = new ActiveXObject ("Word.Application");
var odc = owd.documents.add ();
ODC.ShowgrammaticalRRS = False;
Odc.showspellinger = false;
var orange = odc.range (0,1);
für (i = 0; i <count; i ++)
{{{{
var sel = document.body.createTextrange ();
var tableName = Präfixion+i;
var table = document.getElementById (Tabellename)
Sel.MovetoelementText (Tabelle);
sel.select ();
sel.execcommand ("kopieren");
OWD.Selection.paste ();
OWD.Selection.insertban ();
}
//owd.activedocument.activeWindow.view.type=3 // Setzen Sie den Browsing -Modus
owd.visible = true;
};
Funktion automatisieren (Präfixion)
{{{{
var elim = document.getElementById ("Automatatexzel");
var orangeref = document.body.createTextrange ();
Orangef.movetoeElementText (altable);
Orangef.execcommand ("kopieren");
versuchen {
Var appexcel = new ActiveXObject ("excel.application");
} catch (e)
{{{{
ALERT ("无法调用 Büro 对象 , 请确保您的机器已安装了 Büro 并已将本系统的站点名加入到 IE 的信任站点列表中!");
Zurückkehren;
}
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
};
</script>
</head>
<body>
<Eingabe type = "Button" value = "Exportieren Sie auf das Wort automatisch paging" onclick = "AutomateWordAutopaging ('Tabelle', 5)" />
<Eingabe type = "Button" value = "Exportieren Sie in die Spaltenbreite" onclight = "automatisieren excel ('table')"/>/>
<div id = "automatatexcel">
<Tabelle class = tabp id = "table0" cellspacing = 0 cellpadding = 2 align = center border = 1>
<tr>
<Td align = "center"> title 0 </td>
</Tr>
<tr>
<Td align = "center"> Inhalt 0 </td>
</Tr>
</Table>
<br>
<Tabelle class = tabp id = "table1" cellspacing = 0 cellpadding = 2 align = center border = 1>
<tr>
<Td align = "center"> title 1 </td>
</Tr>
<tr>
<Td align = "center"> Inhalt 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"> Inhalt 2 </td>
</Tr>
</Table>
<br/>
<Tabelle class = tabp id = "table3" cellspacing = 0 cellpadding = 2 align = center border = 1>
<tr>
<Td align = "center"> Titel 3 </td>
</Tr>
<tr>
<Td align = "center"> Inhalt 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>