word报表模板在需要显示的位置填入【标段】
做个窗口按钮,代码:
Dim srr() As String = {"一","二","三","四"}
Dim str As String
Dim bd As String = Tables("表A").Current("标段")
For Each s As String In srr
If s = bd Then
str = str & "■标段" & s
Else
str = str & "□标段" & s
End If
Next
msgbox(str)
Dim tm As String = ProjectPath & "Attachments\订单.doc" '指定模板文件
Dim fl As String = ProjectPath & "Reports\订单.doc" '指定目标文件
Dim wrt As New WordReport(Tables("订单"),tm,fl) '定义一个WordReport
wrt.Replace("【标段】",str)
wrt.Build() '生成报表
wrt.Show() '显示报表