You should use:
While .Execute = True
To do stuff only if something found.
You code is asking for a word or phrase to search for. If found, it checks
whether it is one of the heading styles. If it is a heading style, you try
to make Bold (already bold, isn't it?) and uppercase.
Did you want to expand to the whole paragraph, before doing that?
SearchRange.Expand Unit:=wdParagraph
But if you mess with the SearchRange range with expansion, then you should
reset it before the Wend with:
SearchRange.SetRange = Start:=SearchRange.End, End:=ActiveDocument.End
If a chart is in a frame, then this might be enough:
If Not SearchRange.Information(wdWithInTable) Or _
SearchRange.Information(wdFrameIsSelected) Then
...Select Case ...
End If
> I have the following macro that looks for a word in the document and replaces
> it if it¹s in a Heading style. The problem is it does not get all the words I
[quoted text clipped - 22 lines]
>
> LEU

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
LEU - 13 Jul 2007 02:42 GMT
Hi Russ,
That work great. I did not know about the 'If Not SearchRange' statement.
It's great to learn new things.
Thank you for all your help again.
LEU
> You should use:
> While .Execute = True
[quoted text clipped - 44 lines]
> >
> > LEU
Russ - 13 Jul 2007 03:01 GMT
LEU,
You're Welcome.
I often learn while I help someone, too.
> Hi Russ,
>
[quoted text clipped - 54 lines]
>>>
>>> LEU

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID