Nevermind, that works.
>> Here's what I tried:
>>
[quoted text clipped - 3 lines]
>
> Nevermind, that works.
Be very careful with that "Do stuff" part, though! Most folks would agree (for a
variety of hard-earned knocks) that the best approach is to first build an array of
filenames you want to operate on, then iterate the array.
Also, looking at what you're doing, that's gonna cause issues, anyway. Cleaning it
up a bit, you'd really want something more like:
Dim f As String
f = Dir$("C:\theDirectory\" & theSearchTerm & "*.*")
Do While Len(f)
' Stuff
f = Dir$()
Loop
Later... Karl

Signature
Working Without a .NET?
http://classicvb.org/petition
Jean-Guy Marcil - 19 Oct 2005 22:50 GMT
Karl E. Peterson was telling us:
Karl E. Peterson nous racontait que :
>>> Here's what I tried:
>>>
[quoted text clipped - 8 lines]
> to first build an array of filenames you want to operate on, then
> iterate the array.
Yeah, been there.
I once had a "do stuff" that ended up processing each file twice... Not
what I wanted!

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Jezebel - 20 Oct 2005 00:33 GMT
The other trap is is trying to use Dir$() recursively, to process the
sub-folders. oh dear ...
> Karl E. Peterson was telling us:
> Karl E. Peterson nous racontait que :
[quoted text clipped - 15 lines]
> I once had a "do stuff" that ended up processing each file twice... Not
> what I wanted!
Karl E. Peterson - 20 Oct 2005 01:20 GMT
> The other trap is is trying to use Dir$() recursively, to process the
> sub-folders. oh dear ...
That _can_ be nasty, if the recursive call is part of "do stuff", yeah.
But(!), if you understand how Dir works, you most certainly can use it recusively.
See: http://vb.mvps.org/samples/DirDrill

Signature
Working Without a .NET?
http://classicvb.org/petition