以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  文章套打问题请教老师  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=31425)

--  作者:若水三千
--  发布时间:2013/4/15 7:37:00
--  文章套打问题请教老师

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,"出生日期")),"yyyyMMdd"))

        rp.Replace("{姓名}",Tables("资料")(i,"姓名") )

        rp.Replace("{民族}",Tables("资料")(i,"民族"))

        rp.Replace("{日期}",Format(cdate(Tables("资料")(i,"开始时间")),"yyyyMMdd") )

        rp.Replace("{单位}",Tables("资料")(i,"单位"))

        rp.Replace("{原籍}",Tables("资料")(i,"现居地"))

        rp.Replace("{工作开始}",Format(cdate(Tables("资料")(i,"工作开始")),"yyyyMMdd") )

        rp.Replace("{工作结束}",Format(cdate(Tables("资料")(i,"工作结束")),"yyyyMMdd") )

        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,"出生日期")),"yyyyMMdd"))

        rp.Replace("{姓名}",Tables("资料")(i,"姓名") )

        rp.Replace("{民族}",Tables("资料")(i,"民族"))

        rp.Replace("{日期}",Format(cdate(Tables("资料")(i,"开始时间")),"yyyyMMdd") )

        rp.Replace("{单位}",Tables("资料")(i,"单位"))

        rp.Replace("{原籍}",Tables("资料")(i,"原籍"))

        rp.Replace("{工作开始}",Format(cdate(Tables("资料")(i,"工作开始")),"yyyyMMdd") )

        rp.Replace("{工作结束}",Format(cdate(Tables("资料")(i,"工作结束")),"yyyyMMdd") )

        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

请教各位大哥 如何将他自动保存成PDF格式的 不需要一个个预览另存 怎么样可以实现啊 

[此贴子已经被作者于2013-4-15 7:45:23编辑过]

--  作者:若水三千
--  发布时间:2013/4/15 14:00:00
--  
大哥我问得根据我上边的代码如何保存成PDF格式的
--  作者:若水三千
--  发布时间:2013/4/15 14:04:00
--  
木华大哥 我说的时我上边的代码要怎么加 保存PDF格式的 不是表啊 我没有TABLE啊 
--  作者:若水三千
--  发布时间:2013/4/15 14:07:00
--  
木华大哥 我的时WORD格式的 文件套打嘛不是表
[此贴子已经被作者于2013-4-15 14:06:46编辑过]

--  作者:若水三千
--  发布时间:2013/4/15 14:11:00
--  
就是上边那段代码 我把那段做成了按钮 现在可以预览 然后在预览下点保存PDF  我想就是 不需要预览 直接就保存 PDF格式的 要怎么改写代码啊
--  作者:jianyuan
--  发布时间:2013/4/18 22:23:00
--  

我也需要这个问题的答案,老师能给个答案吗!