In this article, we want to share with you 3 ways to quickly delete all section breaks in your Word document.
Section breaks are useful in creating multiple sections in Word document. So you can format different sections in distinctive styles. And here is our previous article for you to quickly insert section breaks in document: 3 Ways to Quickly Insert Section Breaks into Your Word Document
However, it’s quite common to revise a document, such as changing styles, re-dividing sections, etc. Particular, if there is a big adjustment to make, you will probably need to remove all sections breaks. Following are 3 methods you can utilize to delete section breaks in batch.
Method 1: Find All Section Breaks in the Document
- First of all, press “Ctrl+ H” to open “Find and Replace” box in Word.
- Next put cursor inside “Find what” text box.
- Click “More” button to get more options.
- Then click “Special” and choose “Section Break” on its menu. Then you will see “^b” in “Find what” text box. So an alternative way is to enter “^b” directly after step 2.
- Lastly, leave “Replace with” box blank and click “Replace All”. Click “OK” on the confirmation box.
Method 2: Run a Macro to Delete All Section Breaks in One Document
Here is the auto way for you to get rid of all unwanted section breaks.
- To begin with, open VBA editor in Word by hitting “Alt+ F11”.
- Then create a new module by clicking “Normal”.
- Next click “Insert” and select “Module”.
- Now open module with double click.
- In the coding space on the right side, paste the following codes:
Sub DeleteAllSectionsInOneDoc() With Selection .HomeKey Unit:=wdStory With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Text = "^b" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End With End Sub
- Finally, click “Run”.
You will find all section breaks nowhere in a second.
Method 3: Delete All Section Breaks in Multiple Documents
Similarly, we must run a macro if we want to do it in a quick and dirty way.
- Before all, put all target documents in one folder.
- Then install a macro with steps in method 2.
- Run this macro instead:
Sub DeleteAllSectionBreaksInMultiDoc() Dim StrFolder As String Dim strFile As String Dim objDoc As Document Dim dlgFile As FileDialog Set dlgFile = Application.FileDialog(msoFileDialogFolderPicker) With dlgFile If .Show = -1 Then StrFolder = .SelectedItems(1) & "\" Else MsgBox "No folder is selected! Please select the target folder." Exit Sub End If End With strFile = Dir(StrFolder & "*.docx", vbNormal) While strFile <> "" Set objDoc = Documents.Open(FileName:=StrFolder & strFile) With Selection .HomeKey Unit:=wdStory With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Text = "^b" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End With objDoc.Save objDoc.Close strFile = Dir() Wend End Sub
- Next in the “Browse” window open, select the folder to which you save documents.
- Last but not the least, click “OK”.
Get Prepared for Data Loss
Normally, with good operation habit, good luck and all blessings, you can achieve a lot in Word. But crashes can strike you anytime. Thus it’s of vital importance to back up documents on a regular basis. With a backup in hand, you will be more confident before starting the docx fix.
Author Introduction:
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including xls recovery and pdf repair software products. For more information visit www.datanumen.com
Leave a Reply