
Tips.Net > WordTips Home > Editing > Removing Extra Paragraph Marks
Summary: Part of working with other people’s documents is cleaning them up so that they are easier to maintain and format. One common task is removing extra paragraph marks in the document. The macro in this tip makes short work of removing all the extra paragraph marks. (This tip works with Microsoft Word 97, Word 2000, Word 2002, and Word 2003.)
There may be times when you are working with a document when you have a need to remove extra paragraph marks. This is particularly true if you are working with an ASCII file or a file that may have originally been formatted with another word processor. This process of manually removing extra paragraph marks can be very time consuming.
If you find yourself in this situation, you may find this macro of interest. It removes extra paragraph marks from a document. When it is completed, there should not be even two paragraph marks in a row in your document.
Sub ReplacePara()
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^p^p"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
While Selection.Find.Found
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Find.Execute
Wend
End Sub
Tip #998 applies to Microsoft Word versions: 97 2000 2002 2003
Ultimate Library! The most amazing collection ever offered in the history of WordTips places every tip—present and historical—at your fingertips. Check out the WordTips Ten-Year Library.
Learn to search for and replace text, formatting, graphics, and special characters the easy way with WordTips: Find and Replace. (more information...)
Ask a Word Question
Make a Comment
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Pet Tips
Word2007 Tips
WordTips