Getting rid of hard line breaks in pasted text.
I cut and paste a lot from pdfs and inevitably it leaves a lot of line breaks lying around. When this occurs in Word I wrote a little macro to replace them out. Here it is below. How do I amend this so that when I come across a Note, Topic/Sub-Topic I can selectively remove them with a minjet macro.
Sub pagebreaks()
I cut and paste a lot from pdfs and inevitably it leaves a lot of line breaks lying around. When this occurs in Word I wrote a little macro to replace them out. Here it is below. How do I amend this so that when I come across a Note, Topic/Sub-Topic I can selectively remove them with a minjet macro.
Sub pagebreaks()
' ' pagebreaks Macro ' ' Selection.Find.ClearFormatting Selection.Find.Replacement.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 Replace:=wdReplaceAll With Selection.Find .Text = "^p" .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 With Selection.Find .Text = "|" .Replacement.Text = "^p^p" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End Sub
Be the first to post a reply!