vicb
This macro will clean up line breaks. See:
http://www.gmayor.com/installing_macro.htm if you need help applying:
Sub CleanUpText()
Dim EP As Paragraph
Dim TextChar As String
Dim bCutChars As Boolean
If MsgBox("Do you want to remove leading spaces or characters?", vbYesNo) =
vbYes Then
ActiveDocument.Range(0, 0).Select
Selection.Range.InsertAfter Chr(13)
bCutChars = True
CUTReplaceSpecific "(^13)( {1,})", "\1"
CUTReplaceSpecific "(^l)( {1,})", "\1"
CUTReplaceSpecific "(^l)([\> ]{1,})", "\1"
CUTReplaceSpecific "(^13)([\> ]{1,})", "\1"
CUTReplaceSpecific "(^l)([\<]{1,})", "\1"
CUTReplaceSpecific "(^13)([\<]{1,})", "\1"
CUTReplaceSpecific "(^13)( {1,})", "\1"
CUTReplaceSpecific "(^l)( {1,})", "\1"
CUTReplaceSpecific "( {1,})(^13)", "\2"
CUTReplaceSpecific "( {1,})(^l)", "\2"
Do
TextChar = InputBox("Type a single character of the next leading
character" _
& " that you want to remove. Click cancel to exit.")
If TextChar = "" Then
Exit Do
ElseIf InStr("*(){}[]!@?", TextChar) > 0 Then
CUTReplaceSpecific "(^13)\" & TextChar & "{1,}", "\1"
CUTReplaceSpecific "(^l)\" & TextChar & "{1,}", "\1"
Else
CUTReplaceSpecific "(^13)" & TextChar & "{1,}", "\1"
CUTReplaceSpecific "(^l)" & TextChar & "{1,}", "\1"
End If
Loop While TextChar > ""
End If
If MsgBox("Do you want to replace linebreaks with paragraph fromatting?",
vbYesNo) = vbYes Then
CUTReplaceSpecific "^l{2,}", "^p"
CUTReplaceSpecific "^l", " "
End If
If MsgBox("Do you want to delete empty paragraphs in this document?",
vbYesNo) = vbYes Then
For Each EP In ActiveDocument.Paragraphs
If Len(EP.Range.Text) = 1 Then EP.Range.Delete
Next EP
ElseIf bCutChars Then
ActiveDocument.Range(0, 0).Select
ActiveDocument.Paragraphs(1).Range.Delete
End If
End Sub