跳到主要內容

如何從Word文檔中刪除所有水平線?

水平線可以清楚地劃分段落。 許多用戶已經知道他們可以通過鍵入三個連字符,下劃線或星號等,然後按Enter鍵來向文檔添加水平線。 看截圖:

doc刪除水平線1

如何從文檔中刪除所有水平線? 本教程將告訴您答案。

手動一一刪除所有水平線

使用VBA代碼刪除所有水平線

用Kutools for Word刪除所有水平線


手動一一刪除所有水平線

如果只想刪除幾條水平線,則可以按以下步驟手動刪除它們:

1。 將光標放在該行上方;

2。 點擊 頁面邊框 中的項目 頁面背景 一組 設計 標籤;

doc刪除水平線2

3。 點擊 邊框 標籤,點擊 與機身相同顏色點擊此處成為Trail Hunter 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  /  將頁面匯出為圖像  /  一次列印多個文件 ...

內容編輯: 批量查找和替換 跨多個文件   /  調整所有圖片的大小   /  轉置表行和列  /  將表格轉換為文字 ...

🧹 輕鬆清潔掃開 多餘的空間  /  分節符  /   所有標題  /  文本框  /  超鏈接  /  如需更多刪除工具,請前往我們的刪除群組

創意插入: 插入 千位分隔符  /  複選框  /  單選按鈕  /  QR Code  /  條碼  /  對角線表  /  公式標題  /  圖片說明  /  表格標題  /  多張圖片  /  在我們的插入組中發現更多信息

🔍 精準選擇: 精確定位特定頁面  /    /  形狀  /  標題段落  /  使用我們的選擇組輕鬆導航

星級增強: 快速導航至任何位置  /  自動插入重複文字  /  在文檔視窗之間無縫切換  /  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