跳到主要內容

如何從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 人工智慧助手:用人工智慧改變你的寫作 - 生成內容  /  重寫文字  /  總結文件  /  查詢資料 基於文檔,全部在Word中

📘 文件掌握: 分頁  /  合併文件  /  以各種格式匯出選擇(PDF/TXT/DOC/HTML...)  /  批次轉換為PDF  /  將頁面匯出為圖像  /  一次列印多個文件...

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

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

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

🔍 精準選擇:精確定位 特定頁面  /    /  形狀  /  標題段落  / 增強導航功能 更多 選擇功能...

星級增強: 快速導航至任何位置  /  自動插入重複文字  /  在文檔視窗之間無縫切換  /  11 轉換工具...

???? 想嘗試這些功能嗎? Kutools for Word 提供了 60天免費試用,沒有任何限制! 🚀
 
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