Hi Kanga,
In case you've got line-feeds at the end of each logical line, try something along the lines of:
Sub LineFormatter()
Dim oRng As Range
Dim i As Long
With ActiveDocument
With .Content.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "^l"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
End With
For i = 1 To .Paragraphs.Count
If i Mod 2 = 0 Then
.Paragraphs(i).Range.Bold = True
Else
.Paragraphs(i).Range.Bold = False
End If
Next i
With .Content.Find
.Text = "^p"
.Replacement.Text = "^l"
.Execute Replace:=wdReplaceAll
.Text = "^l^p"
.Replacement.Text = ""
.Execute Replace:=wdReplaceAll
End With
End With
End Sub
--
Cheers
macropod
[MVP - Microsoft Word]
Kanga 85 said:
Thanks Graham,
I actually want lines rather than paragraphs, but I should be able to modify
your macro (or my docu,ment).