vb.net2005 利用创建好的WORD模板制作WORD报表
来源:互联网 发布:淘宝信用卡怎么分期 编辑:程序博客网 时间:2024/09/21 09:25
Dim WordAPP As New Word.Application
Dim WordDocument As Word.Document
WordDocument = WordAPP.Documents.Open(Application.StartupPath & "/report.doc")
WordDocument.Activate()
'进行查找替换
With WordAPP.Selection.Find
.ClearFormatting()
.Replacement.ClearFormatting()
.Text = "C1"
.Replacement.Text = "小样门诊室"
.MatchCase = True
.Execute(, , , , , , , , , , Word.WdReplace.wdReplaceAll)
End With
With WordAPP.Selection.Find
.ClearFormatting()
.Replacement.ClearFormatting()
.Text = "C2"
.Replacement.Text = "小样路"
.MatchCase = True
.Execute(, , , , , , , , , , Word.WdReplace.wdReplaceAll)
End With
With WordAPP.Selection.Find
.ClearFormatting()
.Replacement.ClearFormatting()
.Text = "C3"
.Replacement.Text = "小样"
.MatchCase = True
.Execute(, , , , , , , , , , Word.WdReplace.wdReplaceAll)
End With
With WordAPP.Selection.Find
.ClearFormatting()
.Replacement.ClearFormatting()
.Text = "C4"
.Replacement.Text = "1100101010"
.MatchCase = True
.Execute(, , , , , , , , , , Word.WdReplace.wdReplaceAll)
End With
With WordAPP.Selection.Find
.ClearFormatting()
.Replacement.ClearFormatting()
.Text = "C5"
.Replacement.Text = "药品项目^l检查项目"
.MatchCase = True
.Execute(, , , , , , , , , , Word.WdReplace.wdReplaceAll)
End With
With WordAPP.Selection.Find
.ClearFormatting()
.Replacement.ClearFormatting()
.Text = "C6"
.Replacement.Text = "小草^l手术费"
.MatchCase = True
.Execute(, , , , , , , , , , Word.WdReplace.wdReplaceAll)
End With
With WordAPP.Selection.Find
.ClearFormatting()
.Replacement.ClearFormatting()
.Text = "C7"
.Replacement.Text = "10^l5"
.MatchCase = True
.Execute(, , , , , , , , , , Word.WdReplace.wdReplaceAll)
End With
With WordAPP.Selection.Find
.ClearFormatting()
.Replacement.ClearFormatting()
.Text = "C8"
.Replacement.Text = "2^l1"
.MatchCase = True
.Execute(, , , , , , , , , , Word.WdReplace.wdReplaceAll)
End With
With WordAPP.Selection.Find
.ClearFormatting()
.Replacement.ClearFormatting()
.Text = "C9"
.Replacement.Text = "20^l5"
.MatchCase = True
.Execute(, , , , , , , , , , Word.WdReplace.wdReplaceAll)
End With
WordAPP.Visible = True
'^l为手动换行符 1为字母L 也以换个两个数字1 换成数字后如果后面跟数字可能会有点问题。所以建议使用字母
'^p为硬回车
图1为没有替换这前的模板内容
图2为替换了内容后的文档
- vb.net2005 利用创建好的WORD模板制作WORD报表
- vb.net2005 利用利用文字型窗体域制作WORD报表
- 基于Word模板的快速报表生成
- WORD模板制作
- 利用vb操作word的基本方法
- word模板生成word报表文档
- VB.NET 创建WORD文档
- 利用Word打印报表(三)----在jsp中利用word打印指定格式的会议记录
- POI应用:利用word模板批量生成word文档(java中word文档的读写)
- 利用Word VBA制作选择题
- 利用WORD制作水印效果
- 利用WORD制作水印效果
- MFC/VC++调用word进行报表制作
- MFC/VC++调用word进行报表制作
- 根据word模板生成word表格报表文档(C#)
- 根据word模板生成word表格报表文档(C#)
- 利用C++Builder 中OLE自动化功能实现调用Word进行报表制作
- 利用C++Builder 6 中OLE自动化功能实现调用Word进行报表制作
- IIS架构与HTTP请求处理流程(2)
- 女人、操作系统和编程语言之间的关系
- 服务器端进行表单验证是很需要的
- 删除下行语句的注释,把浏览器的背景改变看看
- oracle 物理备份恢复
- vb.net2005 利用创建好的WORD模板制作WORD报表
- 使用Visual C#制作可伸缩个性化窗体
- c#中如何调用vc++写的动态链接库
- 接口(八)事件与接口编程
- 接口(九)用接口和抽象类,与不用究竟究竟有什么区别或好处?
- Visual Studio 2008 Express
- 接口(十)初始化一个接口实例
- 动态规划法
- Visual C++ vs C++ Builder