Dim tbl As Table = Tables("资料")
Dim n As Integer= (tbl.BottomRow-tbl.TopRow)+1 Mod 2
n = n Mod 2
Dim m As Integer
For i As Integer = tbl.TopRow To tbl.BottomRow
If n=1 AndAlso i=tbl.BottomRow Then
Dim rp As New RtfPrinter("c:\data\5.rtf")
rp.Replace("{出生日期}", Format(cdate(Tables("资料")(i,"出生日期")),"yyyy年MM月dd日"))
rp.Replace("{姓名}",Tables("资料")(i,"姓名") )
rp.Replace("{民族}",Tables("资料")(i,"民族"))
rp.Replace("{日期}",Format(cdate(Tables("资料")(i,"开始时间")),"yyyy年MM月dd日") )
rp.Replace("{单位}",Tables("资料")(i,"单位"))
rp.Replace("{原籍}",Tables("资料")(i,"现居地"))
rp.Replace("{工作开始}",Format(cdate(Tables("资料")(i,"工作开始")),"yyyy年MM月dd日") )
rp.Replace("{工作结束}",Format(cdate(Tables("资料")(i,"工作结束")),"yyyy年MM月dd日") )
rp.Replace("{工龄}",Tables("资料")(i,"工龄") )
rp.Replace("{工种}",Tables("资料")(i,"工种"))
rp.Replace("{时间}",Tables("资料")(i,"时期") )
rp.Replace("{奖金}",Tables("资料")(i,"奖金"))
rp.Replace("{累计}",Tables("资料")(i,"累计"))
rp.Replace("{当年}",Tables("资料")(i,"当年"))
rp.Replace("{职业}",Tables("资料")(i,"职业"))
rp.Replace("{资料时间}",Tables("资料")(i,"资料"))
rp.Replace("{文化程度}",Tables("资料")(i,"文化程度"))
rp.Preview()
Else
Dim rp As New RtfPrinter("c:\data\5.rtf")
rp.Replace("{出生日期}", Format(cdate(Tables("资料")(i,"出生日期")),"yyyy年MM月dd日"))
rp.Replace("{姓名}",Tables("资料")(i,"姓名") )
rp.Replace("{民族}",Tables("资料")(i,"民族"))
rp.Replace("{日期}",Format(cdate(Tables("资料")(i,"开始时间")),"yyyy年MM月dd日") )
rp.Replace("{单位}",Tables("资料")(i,"单位"))
rp.Replace("{原籍}",Tables("资料")(i,"原籍"))
rp.Replace("{工作开始}",Format(cdate(Tables("资料")(i,"工作开始")),"yyyy年MM月dd日") )
rp.Replace("{工作结束}",Format(cdate(Tables("资料")(i,"工作结束")),"yyyy年MM月dd日") )
rp.Replace("{工龄}",Tables("资料")(i,"工龄") )
rp.Replace("{工种}",Tables("资料")(i,"工种"))
rp.Replace("{时间}",Tables("资料")(i,"时期") )
rp.Replace("{奖金}",Tables("资料")(i,"奖金"))
rp.Replace("{累计}",Tables("资料")(i,"累计"))
rp.Replace("{资料时间}",Tables("资料")(i,"资料"))
rp.Replace("{当年}",Tables("资料")(i,"当年"))
rp.Replace("{职业}",Tables("资料")(i,"职业"))
rp.Replace("{文化程度}",Tables("资料")(i,"文化程度"))
rp.Preview()
End If
i=i+1
Next