原公式:
Dim dr As DataRow = Tables("平台").current.DataRow
If dr("施工类别")=
"年审" Then
Dim tm As String = ProjectPath & "Attachments记录年检.docx" '指定模板文件
Next
Else
Dim tm As String = ProjectPath & "Attachments\记录.docx" '指定模板文件
End If
Dim t As Table = Tables("平台")
For i As Integer = t.TopPosition To t.BottomPosition
Dim r As Row = t.Rows(i)
Dim fl As String = "d:\use\平台\" &
r("出厂编号") &"-" & r("工作日期") &"记录" &".doc"
'指定目标文件
Dim wrt As New WordReport(t,tm,fl) '定义一个WordReport
wrt.Buildone(r) '逐行生成报表
wrt.quit
Next
要求:用鼠标已选择多条记录,要根据字段施工类别内容自动选择相应WORD模板,批量生成WORD文件,怎样修改原公式?
[此贴子已经被作者于2023/4/15 7:01:04编辑过]