使用VB.NET从word文档中删除3行代码 [英] Deleting 3 lines of code from a word document using VB.NET

查看:386
本文介绍了使用VB.NET从word文档中删除3行代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个word文档,其中包含一个合并字段和3行地址。例如,



<<< SAMPLEMERGEFIELD>>

ADDRESS LINE 1

ADDRESS第2行

状态




通过我的vb.net应用程序,我将使用从数据库中检索的值替换merge字段。此功能正常工作。

如果从数据库检索的值为NULL,那么我想删除<<<<&#SAMPLEMERGEFIELD>>以及之后的3行。

你有代码来完成这个吗?

Hi,

I have a word document which has a merge field and 3 lines of address after that. For example,

<<SAMPLEMERGEFIELD>>
ADDRESS LINE 1
ADDRESS LINE 2
STATE


Through my vb.net application, I am replacing merge field with the value retrieved from the database. This functionality is working properly.
If value retrieved from database is NULL, then I would like to delete the <<SAMPLEMERGEFIELD>> as well as the 3 lines after that.
Do you have code to accomplish this?

推荐答案

我真的相信有一个选项跳过NULL数据。



看看这里:

邮件合并:第一部分 [ ^ ]

邮件合并:第二部分 [ ^ ]



如果你还想删除部分数据,你需要知道没有行,有段落 [ ^ ]。
I really do believe there is an option to skip NULL data.

Have a look here:
Mail Merge: Part I[^]
Mail Merge: Part II[^]

If you still want to delete some portion of data, you need to know there is no "lines", there are paragraphs[^].


这篇关于使用VB.NET从word文档中删除3行代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆