Dim tm As String = ProjectPath & "Attachments\12.doc" '指定模板文件
Dim fl As String = ProjectPath & "Reports\12.doc" '指定目标文件
Dim wrt As New WordReport(Tables("表A"),tm,fl) '定义一个WordReport
wrt.Build() '逐行生成报表
wrt.Quit
Dim app As New MSWord.Application
try
Dim fileName =ProjectPath & "Reports\12.doc"
app.Documents.Open(fileName)
'app.Documents(fileName).PrintPreview
'app.Visible = True
app.Documents(fileName).PrintOut '打印
catch ex As exception
msgbox(ex.message)
finally
app.Quit
End try
以上这样可以,但屏幕闪烁一下,是什么原因呢?
[此贴子已经被作者于2014-4-18 19:40:06编辑过]