The information in the article "Find & ReplaceAll on a batch of documents in
the same folder" at:
http://word.mvps.org/FAQs/MacrosVBA/BatchFR.htm
will show you how to operate on all of the files in a folder.
The code to do the find/save would be something like
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[0-9]{10}", MatchWildcards:=True,
Wrap:=wdFindStop, Forward:=True) = True
If Selection.Range = 1234567890 Then
ActiveDocument.SaveAs "FFTC"
Exit Sub
Else
ActiveDocument.SaveAs "ZZLC"
Exit Sub
End If
Loop
End With
You will however have to graft that into the info in the referenced article.
Not your example only contained an 8 digit number. What are you going to do
about overwriting the documents that have already been saved.
--
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 paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
Tony said:
I have 25 documents that I open and reformat with a macro. Each
document has a specific 10 digit number. How can I run one macro on
each file and have it save the file as a specific name. ex. If .Text =
"12354678" I want to save the doc as FFTC if .Text = "87654321" then
save as ZZLC. Help please just a point in the right direction can help
Thanks