Dim tm As String = ProjectPath & "Attachments\人员简历表.doc" '指定模板文件
Dim Sum As Integer
Dim p As String = "([省市区县乡镇村街])"
With Tables("员工资料")
If .TopPosition > -1 Then '如果选定区域包括数据行
For i As Integer = .TopPosition To .BottomPosition
Dim r As Row = .Rows(i)
Dim s As String=r("第一列")
Dim rg As New System.Text.RegularExpressions.Regex(p)
Dim str = rg.Split(s)
Dim fileName As String = ProjectPath & "Reports\" & str(2) & str(3) & "\" & r("第一列") & ".doc"
Dim wrt As New WordReport(Tables("员工资料"),tm,fileName) '定义一个WordReport
wrt.BuildOne(r)
wrt.quit
Sum = Sum + 1
Next
End If
End With