
Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
If you want to avoid deleting longer strings containing a "7", use
".MatchWildcards = True" and ".Text = "<7[0-9]{4}>".
You might still match some decimal numbers like 71234.56 -- if that could be
a problem, you'd need a more complicated wildcard replacement.
Say,
.Text = "<7[0-9]{4}>([!,.\-])"
.Replacement.Text = "\1"
If you know there's a space in front or after the number, you could include
that in the Find expression, else you could replace two spaces with one
afterwards to clean them up.
Greetings,
Klaus
>> Hi,
>>
[quoted text clipped - 10 lines]
> .Execute Replace:=wdReplaceAll
> End With
Jarryd - 27 Mar 2006 10:25 GMT
Hi Jonathan and Klaus. All sorted now, thanks to you.
Jarryd
> If you want to avoid deleting longer strings containing a "7", use
> ".MatchWildcards = True" and ".Text = "<7[0-9]{4}>".
[quoted text clipped - 27 lines]
>> .Execute Replace:=wdReplaceAll
>> End With