Option Explicit
Sub RemoveHARDReturns()
Dim DescriptionLine As Long
Dim AdditionalInfoLine As Long
'move cursor to top of document
Selection.HomeKey _
unit:=wdStory
With Selection
With .Find
.Forward = True
.ClearFormatting
.Text = "Additional Information"
.Wrap = wdFindContinue
.Execute
End With
'get the line number of add'l info txt, move up one line
AdditionalInfoLine = Selection.Range.Information(wdFirstCharacterLineNumber) - 1
With .Find
.Forward = True
.ClearFormatting
.Text = "Description"
.Wrap = wdFindContinue
.Execute
End With
'get line number
DescriptionLine = Selection.Range.Information(wdFirstCharacterLineNumber)
End With
Debug.Print "desc: " & DescriptionLine, " add'l info: " & AdditionalInfoLine
Selection.MoveDown _
unit:=wdLine
Selection.MoveDown _
unit:=wdLine, _
Count:=AdditionalInfoLine - DescriptionLine - 2, _
Extend:=True
' replace ^p paragraph codes
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute _
Replace:=wdReplaceAll
End Sub
Bookmarks