asp的,需要稍做修改
Dim objWordApp
Dim objWordDoc
Set objWordApp = Server.CreateObject("Word.Application.9")
Set objWordDoc = objWordApp.Documents.Open("c:/test.doc")
Dim workTable
Set workTable = objWordDoc.Tables(i+1)
'加入容纳数据的空行
Dim j
For j = 1 To (ctrctRecCount -1 )
workTable.Rows.Add()
Next
'加入容纳数据的空行
If i = UBound(arShipNames) Then
workTable.Rows.Add()
workTable.Cell(ctrctRecCount+3, 1).Range.Text = "合计"
End If
objWordDoc.SaveAs(sTempPath & "/" & sTempDoc)
objWordDoc.Close
objWordApp.Quit
Set objWordApp = Nothing
Set objWordDoc = Nothing