Yes, if you define what you mean by "line". Lines are printer-dependent and
are not necessarily always the same unless you have explicitly delimited
them. If you really mean paragraphs, here is one way:
For Each Sect In ActiveDocument.Sections
With Sect.Range.Find
.Text = "[!^13]@^13[!^13]@^13[!^13]@^13"
.Replacement.Font.Bold = True
.MatchWildcards = True
.Execute Replace:=wdReplaceOne
End With
Next
>I have a document with several sections in it. Is it possible for me to
> write a macro that bolds the first 3 lines of each section?
Hi Tony,
originally, I wanted to check, whether your macro bolds
the section break character, too.
Never mind, it isn't that important.
But then, using a rather simple doc of 9 pages, I get,
first:
Run-time error 5226: The document is too large for Word to handle.
or
command failed
pointing to this line: .Execute Replace:=wdReplaceOne
Next:
The document is too large too save.
Next:
Run-time error: -2147417848
The object invoked has disconnected from its clients.
Next:
Word doesn't respond anymore: CPU > 95 percent.
Just another corrupted doc, or what?
At least, this is reproducable.
I've sent you a copy.
Any ideas?
Happy thinking

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
Tony Jollans - 13 Jan 2007 23:23 GMT
Hi Helmut,
This is a bug in F&R - with somewhat exaggerated effect.
When the text which ought to be found by a wildcard search contains a Field,
F&R doesn't work properly. You have a hyperlink in the third paragraph of
the matched text in section 1 (actually the fourth paragraph but my sloppy
code ignores empty paragraphs).

Signature
Enjoy,
Tony
> Hi Tony,
>
[quoted text clipped - 29 lines]
>
> Happy thinking