Dim tm As String = ProjectPath & "Attachments\123.doc" '指定模板文件
Dim fl As String = ProjectPath & "Reports\123.doc" '指定目标文件
Dim wrt As New WordReport(Tables("表B"),tm,fl) '定义一个WordReport
wrt.Build() '逐行生成报表
wrt.Quit
Dim app As New MSWord.Application
try
Dim doc = app.Documents.Open(fl)
For Each shape As object In doc.InlineShapes
If shape.Type = MSWord.WdInlineShapeType.wdInlineShapePicture
system.threading.thread.sleep(50)
shape.ConvertToShape
End If
Next
doc.saved = True
app.visible = True
catch ex As exception
msgbox(ex.message)
app.Quit
finally
End try