1、生成条形码参考
Dim tm As String = ProjectPath & "Attachments\员工资料卡.doc" '指定模板文件
Dim fl As String = ProjectPath & "Reports\员工资料卡.doc" '指定目标文件
Dim mg As String = ProjectPath & "Images\二维码.wmf" '约定的图片文件
Dim wrt As New WordReport(Tables("员工"),tm,fl) '定义一个WordReport
For Each r As Row In Tables("员工").Rows '逐行生成报表
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.Code39
Bar.Code = r("列名")
Bar.BarRatio = 0.3
Bar.BarHeight = 8
bar.SaveImage(mg,300)
wrt.BuildOne(r)
Next
wrt.Show() '显示报表
2、代码单独做一个按钮,点击按钮后生成word报表。