find & Replace with wild cards and patterns 
Author Message
 find & Replace with wild cards and patterns

The issue is finding a pattern (like international
telephone #'s, email addresses) from a list inside word
(500 pages), replacing that same selection with additions
then looping through the document to find all
instances....ie finding a fone # like 78598555512 and
replacing the number with 78-59-855-5512 adding hyphens...




Tue, 03 Jan 2006 07:26:23 GMT  
 find & Replace with wild cards and patterns
Hi, Colin,

See http://www.mvps.org/word/FAQs/General/UsingWildcards.htm

--
Regards,
Jay Freedman
Microsoft Word MVP     FAQ: http://www.mvps.org/word

Quote:

> The issue is finding a pattern (like international
> telephone #'s, email addresses) from a list inside word
> (500 pages), replacing that same selection with additions
> then looping through the document to find all
> instances....ie finding a fone # like 78598555512 and
> replacing the number with 78-59-855-5512 adding hyphens...





Tue, 03 Jan 2006 09:52:35 GMT  
 find & Replace with wild cards and patterns
Hi Colin,

Use the following will do the number thing and give you the information you
need for the others:

    Selection.HomeKey wdStory
    Selection.Find.ClearFormatting
    With Selection.Find
        Do While .Execute(FindText:="[0-9]{11}", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
            Selection.Range.Text = Format(Selection.Range.Text,
"00-00-000-0000")
        Loop
    End With

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested.  Unsolicited questions forwarded
directly to me will only be answered on a consulting basis.

Hope this helps
Doug Robbins - Word MVP

Quote:
> The issue is finding a pattern (like international
> telephone #'s, email addresses) from a list inside word
> (500 pages), replacing that same selection with additions
> then looping through the document to find all
> instances....ie finding a fone # like 78598555512 and
> replacing the number with 78-59-855-5512 adding hyphens...





Tue, 03 Jan 2006 09:58:20 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Wild Card Replace

2. find window wild cards??

3. Replace & Wild Characters Together

4. Wild cards and filenames

5. resolve address wild card

6. Wild card expression help

7. Wild Card search in VB .NET

8. wild card search

9. Wild Card SQL and ADO

10. FileCopy with wild cards?

11. Kill file using wild card

12. Wild Card in FSO

 

 
Powered by phpBB® Forum Software