Hi,
I am doing Find and Replace in MS Word from VB Code.
It was working fine till I installed Office Patch(kb 830349).
There is a piece of code in which I am doing find and replace in my
document, actually replacing some text in the document with a link
object.
The code is as follows

'----------------------------------------------------------
Set objRange = letter.Content
With objRange.Find
.ClearFormatting
If Not .Execute(FindText:="[BodyText]") Then
Set objRange = Nothing
End If
End With

letter.Fields.Add Range:=objRange, Type:=wdFieldLink,
Text:="Word.Document.8 ""c:\\Socrates\\Templates\\Temp\\RTFTemp.rtf""
\a \r"
Set objRange = Nothing
'----------------------------------------------------------

This piece of code was working fine before the update was installed.

After the update install, it gives an error after line:
.ClearFormatting
"Class does not support Automation or does not support expected
interface".

After clicking OK, Memory read error occurs and the application
terminates and if I am running from VB, then it also closes.

Any solution for this will be greatly appreciated

Thanks in advance,
Manish Katiyar

Re: Find and Replace crash when installing Office Security Patch kb830349 by Jezebel

Jezebel
Mon Aug 09 02:28:15 CDT 2004

No blinding revelations, but one things to try: in your declaration, if you
currently have

Dim objRange as Range , change it to

Dim objRange as Word.Range





"Manish Katiyar" <manishkt@noida.hcltech.com> wrote in message
news:b99b909e.0408082314.7f18552d@posting.google.com...
> Hi,
> I am doing Find and Replace in MS Word from VB Code.
> It was working fine till I installed Office Patch(kb 830349).
> There is a piece of code in which I am doing find and replace in my
> document, actually replacing some text in the document with a link
> object.
> The code is as follows
>
> '----------------------------------------------------------
> Set objRange = letter.Content
> With objRange.Find
> .ClearFormatting
> If Not .Execute(FindText:="[BodyText]") Then
> Set objRange = Nothing
> End If
> End With
>
> letter.Fields.Add Range:=objRange, Type:=wdFieldLink,
> Text:="Word.Document.8 ""c:\\Socrates\\Templates\\Temp\\RTFTemp.rtf""
> \a \r"
> Set objRange = Nothing
> '----------------------------------------------------------
>
> This piece of code was working fine before the update was installed.
>
> After the update install, it gives an error after line:
> .ClearFormatting
> "Class does not support Automation or does not support expected
> interface".
>
> After clicking OK, Memory read error occurs and the application
> terminates and if I am running from VB, then it also closes.
>
> Any solution for this will be greatly appreciated
>
> Thanks in advance,
> Manish Katiyar