인쇄하려면 Word에게 전화하십시오 ...
다음 스크립트를 실행하면 IE의 보안 수준을 낮게 설정하거나 중간 보안 수준에서 활성화 할 수 있도록 해당 ActiveX Control을 설정해야합니다.
<html>
<헤드>
<title> buildDocumentByscript </title>
</head>
<tableId = "myData"border = 1align = center>
<tralign = center>
<td> 제품 이름 </td>
<td> 제품 설명 </td>
<td> 제품 단위 가격 </td>
<td> 제품 등급 </td>
</tr>
<tralign = center>
<td> 제품 1 </td>
<td> thisiastest </td>
<tdalign = right> 300.50 </td>
<td> 레벨 1 </td>
</tr>
<tralign = center>
<td> 제품 2 </td>
<td> thisiastest </td>
<tdalign = right> 300.50 </td>
<td> 레벨 1 </td>
</tr>
<tralign = center>
<td> 제품 3 </td>
<td> thisiastest </td>
<tdalign = right> 300.50 </td>
<td> 레벨 1 </td>
</tr>
</tabld>
<inputtype = buttononClick = "vbscript : buildDoc '', 4"value = "build">
<body>
</body>
</html>
<scriptLanguage = "vbscript">
subbuilddoc (thetemplate, inttablerows)
dimtable1
settable1 = document.all.mydata
row = table1.rows.length
setobjworddoc = createobject ( "Word.document")
objworddoc.application.visible = true
DimtheArray (4,4)
'redimpreservethearray (4, 행)
colnum = table1.rows (1) .cells.length
fori = 0Torow-1
forj = 0tocolnum-1
THEARRAY (j+1, i+1) = 표 1.ROWS (i) .Cells (j) .innerHtml
다음
다음
intnumrows = 4
objworddoc.application.activedocument.add.add.range.insertbefore ( "테이블 테이블")
objworddoc.application.activedocument.paragraphs.add.range.insertbefore ( "")
objworddoc.application.activedocument.paragraphs.add.range.insertbefore ( "")
setrngpara = objworddoc.application.activedocument.paragraphs (1) .range
Withrngpara
.bold = true
.paragraphformat.Alignment = 1
.font.name = "arial"
.font.size = 12
끝
setrngcurrent = objworddoc.application.activedocument.paragraphs (3) .range
settabcurrent = objworddoc.application.activedocument.tables.add (rngcurrent, intnumrows, 4)