'''... Dim tm As String = ProjectPath & "Attachments\导检单.doc" '指定模板文件 Dim fl As String = ProjectPath & "Reports\导检单.doc" '指定目标文件 Dim wrt As New WordReport(Tables("表A"),tm,fl) '定义一个WordReport Dim r As Row = Tables("表A").current Dim str() As String = r("内科_诊断建议").Split(";") Dim temp As String = "" For Each s As String In str dim idx as integer = 0 for each ss as string in s.Split("(") if idx = 0 then if temp > "" then temp = temp & vbcrlf & ss else temp = ss end if else temp = temp & vbcrlf & "(" & ss end if idx += 1 next Next wrt.ReplaceOne("[内科_诊断建议]",temp) wrt.Build() wrt.show()
|