文章套打已很接近“邮件合并”功能,“一次性预览”设计请曹老师再指点一下:
Dim n As Integer= Tables("成绩表").Rows.Count Mod 2
For i As Integer = 0 To Tables("成绩表").Count-1
If n=1 Then
Dim rp As New RtfPrinter("C:\Documents and Settings\Administrator\桌面\奖 状.rtf")
rp.Replace("{班级}", Tables("成绩表")(i,"班级") &"班 ")
rp.Replace("{姓名}",Tables("成绩表")(i,"姓名"))
rp.Preview()
Else
Dim rp As New RtfPrinter("C:\Documents and Settings\Administrator\桌面\奖 状.rtf")
rp.Replace("{班级}", Tables("成绩表")(i,"班级") &"班 ")
rp.Replace("{姓名}",Tables("成绩表")(i,"姓名"))
rp.Replace("{班级1}", Tables("成绩表")(i+1,"班级") &"班 ")
rp.Replace("{姓名1}",Tables("成绩表")(i+1,"姓名"))
rp.Preview()
End If
i=i+1
Next