Dim flt As String
Dim tb As Table = e.Form.Controls("table1").Table
For Each xh As Row In Tb.Rows
Dim tm As String = ProjectPath & "Attachments\委托加工合同A.doc" '指定模板文件
Dim fl As String = ProjectPath & "Reports\委托加工合同A.doc" '指定目标文件
Dim wrt As New WordReport(tb,tm,fl) '定义一个WordReport
wrt.Buildone(xh)
Dim app As New MSWord.Application
try
' Dim fileName = "e:\test.doc"
app.Documents.Open(fl)
'app.Documents(fileName).PrintPreview
'app.Visible = True
app.Documents(fl).PrintOut '打印
catch ex As exception
msgbox(ex.message)
finally
app.Quit
End try
Next
[此贴子已经被作者于2014-12-16 10:57:39编辑过]