CSDN博客

img qzr820

vb.net2005 利用利用文字型窗体域制作WORD报表

发表于2008/10/3 10:53:00  1345人阅读

 Dim WordAPP As New Word.Application
        Dim Worddocument As Word.Document

        '打开WORD文档
        Worddocument = WordAPP.Documents.Open(Application.StartupPath & "/report.doc")

 

        Worddocument.FormFields("text1").Result = "小样门诊部"
        Worddocument.FormFields("text2").Result = "小样路"
        Worddocument.FormFields("text3").Result = "小样"
        Worddocument.FormFields("text4").Result = "11001010201"
        Worddocument.FormFields("text5").Result = "药品项目" & Chr(11) & "检查项目"
        Worddocument.FormFields("text6").Result = "小草" & Chr(11) & "手术费"
        Worddocument.FormFields("text7").Result = "10" & Chr(11) & "50"
        Worddocument.FormFields("text8").Result = "2" & Chr(11) & "1"
        Worddocument.FormFields("text9").Result = "20" & Chr(11) & "50"
        '去掉底纹
        Worddocument.FormFields.Shaded = False

        WordAPP.Visible = True

效果如下

 

0 0

相关博文

我的热门文章

img
取 消
img