跳到主要內容

如何刪除Word中的空行?

從網上下載的文檔有太多的空行(手動換行)。 為了節省紙張和空間,我們需要刪除所有空行。 有沒有一種簡單的方法可以刪除所有空行,而不是手動刪除每行? 本教程將列出三種在整個文檔中或所有文檔中刪除所有空行的可用方法:

使用“查找和替換”選項刪除所有空行

用VBA刪除所有空行

用Kutools for Word刪除所有空行


使用“查找和替換”選項刪除所有空行

查找和替換 Word中的函數通常用於刪除所有空行,但是您必須知道這些空行被稱為 手動換行 ,在 尋找什麼 選項。

1。 點擊 更換 首頁 標籤。 看截圖:

doc刪除空的手動行1

2。 當 查找和替換 彈出對話框,單擊 更多>> 按鈕以顯示更多選項。 然後將光標放在 尋找什麼 字段,然後選擇 手動換行 來自 特別 下拉菜單,請參見屏幕截圖:

doc刪除空的手動行2

3。 將有一個“^l”中的字符 尋找什麼 字段,然後單擊 “全部替換”。 所有手動換行符已被一次刪除,請參見屏幕截圖:

doc刪除空的手動行3


用VBA刪除所有空行

另外,如果您擅長使用VBA代碼,則可以使用宏刪除所有空行,並且可以按照以下說明進行操作:

1。 按 Alt + F11 打開 Microsoft Visual Basic應用程序 窗口。

2。 點擊 插入 > 模塊,然後將下面的VBA代碼複製到模塊窗口中。

VBA代碼:刪除文檔中的所有手動換行符:

Sub Deleemptylines()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^l"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

3。 然後點擊 運行子 按鈕運行代碼,所有手動換行符將被刪除。


用kutools for Word刪除所有空行

上面的方法需要一些步驟才能刪除所有空行,但是 Kutools for Word,只需單擊一下即可幫助您完成此操作。

Kutools for Word : 帶有超過100個方便的Word加載項,可以在60天內免費試用. 

1。 請通過單擊應用此實用程序 庫工具 > 空參數 > 刪除空的手動換行符。 看截圖:

2。 然後會彈出一個提示框,提醒您刪除所有空行,請單擊 按鈕,請參見屏幕截圖:

doc刪除空的手動行5

3。 點擊後 ,您可以看到所有空行已從文檔中刪除。 看截圖:

doc刪除空的手動行3

備註:如果只需要刪除選擇中的空行,則應在應用此功能之前選擇範圍。

點擊下載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 (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Try to replace ^l^l with this ^l
This comment was minimized by the moderator on the site
^p works if you want to remove blank lines. Just keeping this thread alive as it's still relevant.
This comment was minimized by the moderator on the site
Try finding ^p^p with ^p for paragraphs markers and ^l^l with ^l for line markers.
This comment was minimized by the moderator on the site
Thank you 'extendoffice' your solution worked for me
This comment was minimized by the moderator on the site
for my doc i needed to use the word replace function find: ^p replace with:^l
This comment was minimized by the moderator on the site
Works for me. Thank you :)
This comment was minimized by the moderator on the site
Does not work. The ^l is ignored.
This comment was minimized by the moderator on the site
Thank you, this made an assignment much easier for me!
This comment was minimized by the moderator on the site
The remove empty paragraph marks doesn't work properly.
This comment was minimized by the moderator on the site
Not working !!!!!!!!!!!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations