اتصل بالكلمة للطباعة ...
يتطلب تشغيل البرامج النصية التالية إعداد مستوى أمان أي IE إلى انخفاض ، أو تحديد عنصر تحكم ActiveX لتمكينه على مستوى الأمان المتوسط ، لا تنسى:
<html>
<head>
<title> buildDocumentByscript </title>
</head>
<tableid = "mydata" الحدود = 1Align = المركز>
<tralign = center>
<td> اسم المنتج </td>
<td> وصف المنتج </td>
<td> سعر وحدة المنتج </td>
<td> درجة المنتج </td>
</r>
<tralign = center>
<td> المنتج 1 </td>
<td> thisisastist </td>
<tdalign = يمين> 300.50 </td>
<td> المستوى 1 </td>
</r>
<tralign = center>
<td> المنتج 2 </td>
<td> thisisastist </td>
<tdalign = يمين> 300.50 </td>
<td> المستوى 1 </td>
</r>
<tralign = center>
<td> المنتج 3 </td>
<td> thisisastist </td>
<tdalign = يمين> 300.50 </td>
<td> المستوى 1 </td>
</r>
</tabled>
<inputType = buttonOnClick = "vbscript: builddoc '' ، 4" value = "build">
<body>
</body>
</html>
<scriptLanguage = "vbscript">
subbuilddoc (thetemplate ، inttablerows)
dimtable1
settable1 = document.all.mydata
صف = Table1.Rows.Length
setObjwordDoc = createObject ("word.document")
objworddoc.application.visible = صحيح
DimThearray (4،4)
'RedImpreservethearray (4 ، صف)
colnum = table1.rows (1) .Cells.Length
fori = 0torow-1
forj = 0tocolnum-1
thearray (j+1 ، i+1) = table1.rows (i) .cells (j) .innerhtml
التالي
التالي
intnumrows = 4
objworddoc.application.activedocument.peragraphs.add.range.insertbefore ("جدول للاختبار")
objworddoc.application.activedocument.peragraphs.add.range.insertbefore ("")
objworddoc.application.activedocument.peragraphs.add.range.insertbefore ("")
setrngpara = objworddoc.application.activedocument.paraphs (1) .Range
withrngpara
.bold = صحيح
.paragraphformat.Alignment = 1
.font.name = "arial"
.font.size = 12
endwith
setRngCurrent = objworddoc.application.activedocument.paragraphs (3) .Range
SettabCurrent = objworddoc.application.activedocument.tables.add (rngcurrent ، intnumrows ، 4)