跳到主要内容

如何从Word文档中删除所有水平线?

水平线可以清楚地划分段落。 许多用户已经知道他们可以通过键入三个连字符,下划线或星号等,然后按Enter键来向文档添加水平线。 看截图:

doc删除水平线1

如何从文档中删除所有水平线? 本教程将告诉您答案。

手动一一删除所有水平线

使用VBA代码删除所有水平线

使用 Kutools for Word 删除所有水平线


手动一一删除所有水平线

如果只想删除几条水平线,则可以按以下步骤手动删除它们:

1。 将光标放在该行上方;

2。 点击 页面边框 中的项目 页面背景 一群 设计 标签;

doc删除水平线2

3。 点击 国界 标签,点击 不包含,单击“ OK。 并且所选的水平线将被立即删除。

doc删除水平线3


使用VBA代码删除所有水平线

如果要删除文档中的所有水平线,则手动删除它们很繁琐。 VBA可以使其变得更容易,请执行以下操作:

1。 按 Alt + F11 在Word中打开VBA窗口;

2。 点击 模块插页 标签,然后将代码插入 模块 窗口;

VBA代码:删除Word文档中的所有水平线:

Sub removehline()
Dim ils As Paragraph
For Each ils In ActiveDocument.Paragraphs
ils.Borders(wdBorderBottom).LineStyle =wdLineStyleNone
Next ils
End Sub

3。 点击 运行 按钮或按下 F5 直接应用VBA。 并且所有水平线均已从文档中删除。


使用 Kutools for Word 删除所有水平线

最简单的方法是从整个文档中删除所有水平线,或者使用 Kutools for Word.

Kutools for Word : 带有超过100个方便的Word加载项,可以在60天内免费试用. 

1。 点击 库工具 > 删除水平线,请参见屏幕截图: 

2。 然后整个文档中的所有水平线将被立即删除,请参见屏幕截图:

doc删除水平线5

备注:如果要删除部分水平线,请选择范围数据,然后应用此功能。

点击下载Kutools for Word并立即免费试用!


演示:删除Word中的所有水平线

Kutools for Word:具有100多个方便的Word加载项,可以在60天内免费试用,没有限制。 立即下载并免费试用!


最佳办公生产力工具

Kutools for Word - 通过 Over 提升您的文字体验 100 显着特点!

深入了解下面突出显示的功能或 单击此处探索 Kutools for Word 的全部功能.

📘 文档掌握: 分页  /  合并文件  /  以各种格式导出选择(PDF/TXT/DOC/XLSX)  /  批量转换为PDF  /  将页面导出为图像  /  一次打印多个文件 ...

内容编辑: 批量查找和替换 跨多个文件   /  调整所有图片的大小   /  转置表行和列  /  将表格转换为文字 ...

🧹 轻松清洁扫开 多余的空间  /  分节符  /   所有标题  /  文本框  /  超链接  /  如需更多删除工具,请前往我们的删除组

创意插入: 插页 千位分隔符  /  复选框  /  单选按钮  /  二维码  /  条码  /  对角线表  /  公式标题  /  图片说明  /  表标题  /  多张图片  /  在我们的插入组中发现更多信息

🔍 精准选择: 精确定位特定页面  /    /  形状  /  标题段落  /  使用我们的选择组轻松导航

星级增强: 快速导航至任何位置  /  自动插入重复文本  /  在文档窗口之间无缝切换  /  11 转换工具 ...

使用 Kutools 转换您的 Word 任务。 👉 立即下载并试用 30 天 🚀。

了解更多       免费下载      购买
 
Comments (13)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
The VBA code returns the error 'compile error: must be first statement on line' for the first line. Any thoughts?
This comment was minimized by the moderator on the site
The VBA code returns the error - compile error: must be first statement on line for the first line.
This comment was minimized by the moderator on the site
The VBA code method worked. Thanks so much!
This comment was minimized by the moderator on the site
Thank you, thank you, thank you! I have a multi-gigabyte library of DOCX files that use horizontal lines (=== and ---) as internal section dividers. Thanks to your tip (perhaps the only instance on the web?) I will be able to programmatically split these documents into sub-files. Thanks again
This comment was minimized by the moderator on the site
I love you! OMG. The VBA thing worked!!!! That dump line was driving me crazy.
This comment was minimized by the moderator on the site
140 Ogrady St. Fall River, MA 02720-4911 USA How 3 lines made one line???
This comment was minimized by the moderator on the site
None of this page border stuff worked at all. I searched the document. The horizontal line was at the end, and 10 pages earlier was the culprit, a roman paragraph number lurking in a sentence for no reason at all. When I deleted it it removed the line 10 pages away. I will cut and pate the bugger here. In fact, you can have a set of them from 1 to 6. The then put a line at the bottom of every page. Go figure. MS Word 2007 is the platform. They are there, but do not display. They are just above this line, and will highlight if you mouse over.
This comment was minimized by the moderator on the site
The manual methods did not work, but the VBA code did. Very nice!
This comment was minimized by the moderator on the site
This is amazing!!! BIG THANK YOU for putting the VBA code. Searched in google but yours was the only thing that came up.
This comment was minimized by the moderator on the site
OMG! Thank you. I ran a macro as instructed and managed to remove the line. You were the onlly site among 3 to propose this solution.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations