Greg
Tue Oct 03 22:10:25 CDT 2006
Try:
Sub ScratchMacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "5^#^#"
While .Execute
If oRng < 554 Then
oRng.Select
With Selection
.Collapse wdCollapseEnd
.Bookmarks("\Line").Select
.Range.Bold = True
End With
End If
Wend
End With
End Sub
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
Tailings wrote:
> I have large amounts of imported plain text that I need to format. I
> need a macro that will look for the occurence off any number between
> 500 and 553 followed by two spaces then a hyphen, select the entire
> line containing it and making it bold.
>
> My initial attempt has the code repeated 54 times, with a different
> number each time. There must be an easier way to do it!