A
Aaron van de Sande
I am trying to replace the word formatting with html formatting in
document using find and replace. I know there are much better ways to
do this, but I am supporting an old application architected by someone
else.
Here is the block of code--
r.Find.ClearFormatting
r.Find.Font.bold = True
With r.Find
.text = ""
.Replacement.text = "<b>^&</b>"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
r.Find.Execute Replace:=wdReplaceAll
It seems to work fine, but Word goes into an endless loop when it
encounters a URL. It is possible to replicate using the find and
replace dialog boxes in the word environment.
Any help in this matter would be appreciated.
document using find and replace. I know there are much better ways to
do this, but I am supporting an old application architected by someone
else.
Here is the block of code--
r.Find.ClearFormatting
r.Find.Font.bold = True
With r.Find
.text = ""
.Replacement.text = "<b>^&</b>"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
r.Find.Execute Replace:=wdReplaceAll
It seems to work fine, but Word goes into an endless loop when it
encounters a URL. It is possible to replicate using the find and
replace dialog boxes in the word environment.
Any help in this matter would be appreciated.