Hoppa till huvudinnehåll

Hur tar jag bort alla horisontella linjer från Word-dokument?

Horisontella linjer kan dela stycken tydligt. Många användare vet redan att de kan lägga till horisontella linjer i dokument genom att skriva tre bindestreck, understrykning eller asterisk och så vidare och sedan trycka på Enter. Se skärmdump:

doc ta bort horisontella linjer 1

Hur tar jag bort alla horisontella linjer från dokumentet? Denna handledning kommer att berätta svaren.

Ta bort alla horisontella linjer manuellt en efter en

Ta bort alla horisontella linjer med VBA-kod

Ta bort alla horisontella linjer med Kutools for Word


Ta bort alla horisontella linjer manuellt en efter en

Om du bara vill ta bort några horisontella linjer kan du ta bort dem manuellt enligt följande:

1. Placera markören ovanför raden;

2. Klicka på Sidgränser objekt i Sidan Bakgrund grupp av Designa flik;

doc ta bort horisontella linjer 2

3. Klicka Gränser fliken, klicka Ingen, Klicka OK. Och den valda horisontella raden kommer att tas bort på en gång.

doc ta bort horisontella linjer 3


Ta bort alla horisontella linjer med VBA-kod

Om du vill ta bort alla horisontella linjer i dokumentet är det tråkigt att ta bort dem manuellt. VBA kan göra det enklare, gör enligt följande:

1. Tryck Alt + F11 för att öppna VBA-fönstret i Word;

2. Klicka Modulerna från Insert fliken och infoga koden i Modulerna fönster;

VBA-kod: Ta bort alla horisontella linjer i ett Word-dokument:

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

3. Klicka Körning knappen eller tryck på F5 att tillämpa VBA direkt. Och alla horisontella linjer har tagits bort från dokumentet.


Ta bort alla horisontella linjer med Kutools for Word

Det är enklast att ta bort alla horisontella linjer från hela dokumentet eller urvalet av dokumentet med Kutools för Word.

Kutools för Word : med mer än 100 praktiska Word-tillägg, gratis att prova utan begränsning på 60 dagar. 

1. Klicka kutools > AVLÄGSNAVågrät linje, se skärmdump: 

2. Och sedan tas alla horisontella linjer från hela dokumentet bort på en gång, se skärmdump:

doc ta bort horisontella linjer 5

Anmärkningar: Om du vill ta bort en del av horisontella linjer, välj områdesdata och använd sedan den här funktionen.

Klicka för att ladda ner Kutools for Word och gratis testversion nu!


Demo: Ta bort alla horisontella linjer i Word

Kutools för Word: med mer än 100 praktiska Word-tillägg, gratis att prova utan begränsning på 60 dagar. Ladda ner och testa gratis nu!


Bästa kontorsproduktivitetsverktyg

Kutools för Word - Höj din ordupplevelse med Over 100 Anmärkningsvärda funktioner!

🤖 Kutools AI Assistant: Förvandla ditt skrivande med AI - Generera innehåll  /  Skriv om text  /  Sammanfatta dokument  /  Fråga för information baserat på dokument, allt i Word

📘 Dokumentbehärskning: Dela sidor  /  Sammanfoga dokument  /  Exportera urval i olika format (PDF/TXT/DOC/HTML...)  /  Batchkonvertera till PDF  /  Exportera sidor som bilder  /  Skriv ut flera filer samtidigt...

Innehållsredigering: Batch Hitta och ersätt över flera filer  /  Ändra storlek på alla bilder  /  Transponera tabellrader och kolumner  /  Konvertera tabell till text...

🧹 Enkel rengöring: Svep bort Extra utrymmen  /  Avsnitt bryter  /  Alla rubriker  /  Textrutor  /  Hyperlänkar  / För fler borttagningsverktyg, gå till vår Ta bort gruppen...

Kreativa inlägg: Föra in Tusen avskiljare  /  Kryssrutor  /  radio Knappar  /  QR-kod  /  Streckkod  /  Diagonal linjebord  /  Bildtext för ekvation  /  Bild Bildtext  /  Tabelltextning  /  Flera bilder  / Upptäck mer i Infoga grupp...

🔍 Precisionsval: Precisera specifika sidor  /  Tabellerna  /  former  /  rubrikerna  / Förbättra navigering med mer Välj funktioner...

Stjärnförbättringar: Navigera snabbt till vilken plats som helst  /  infoga repetitiv text automatiskt  /  växla sömlöst mellan dokumentfönster  /  11 Konverteringsverktyg...

👉 Vill du prova dessa funktioner? Kutools för Word erbjuder en 60-dagars gratis försök, utan begränsningar! 🚀
 
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