帮助的方法有问题,换一种方法。
Dim wrt As New WordReport(Tables("表A"),ProjectPath & "Attachments\T_文件审批.docx","g:\test.docx")
wrt.RecordsOnEachPage = 1 '指定每页打印的记录数
wrt.Build() '逐行生成报表
wrt.Quit() '退出报表
Dim app As New MSWord.Application
try
Dim fileName = "g:\test.docx"
Dim doc = app.Documents.Open(fileName)
app.Documents(fileName).ExportAsFixedFormat("g:\test.pdf", MSWord.WdExportFormat.wdExportFormatPDF)
app.Quit
catch ex As exception
msgbox(ex.message)
app.Quit
End try