Dim pString as string
pString = "Goodbye"
With Selection.Find
.ClearFormatting
.Text = "hi"
.Replacement.ClearFormatting
.Replacement.Text = pString
.Execute Replace:=wdReplaceAll, Forward:=True, Wrap:=wdFindContinue
End With
>I am having trouble with using string variable name instead of "hello"
> replacement.text. I am getting type mismatch when I pass it from htm file
[quoted text clipped - 11 lines]
> .Execute Replace:=wdReplaceAll, Forward:=True, Wrap:=wdFindContinue
> End With
Daniel - 14 Jun 2005 13:38 GMT
That is what I did. And somehow I was getting type mismatch error. I changed
to ByVal rString As String, then the message disappeared. But somehow, the
text is not replaced. It finds and highlights it, but does not replace. I am
not sure why.
Thanks
Daniel
> Dim pString as string
>
[quoted text clipped - 23 lines]
> > .Execute Replace:=wdReplaceAll, Forward:=True, Wrap:=wdFindContinue
> > End With