I'm trying to loop through the files in a folder to use FileCopy. The files
have no dot-extension suffix, and FIleSearch can't see them. If I rename
them with a .doc, it works great. Can someone help me tweak this? Or give
me a better method?

Ed

With fs
.LookIn = strPath & "\MyDocs"
.FileName = "*.doc" 'for no extension,
'I used "*"

If .Execute > 0 Then 'with no extension,
'this drops immediately to End If
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
strName = .FoundFiles(i)
strFName = Right(strName, Len(strName) - 9)
MsgBox strFName
FileCopy strName, strFolder & strFName
Next i
End If
End With

RE: Help with App.FileSearch object, please? by PeteBennett

PeteBennett
Tue Oct 26 10:45:06 CDT 2004

Might be a stupid question, but have you tried using "*.*" as your search
filter?

"Ed" wrote:

> I'm trying to loop through the files in a folder to use FileCopy. The files
> have no dot-extension suffix, and FIleSearch can't see them. If I rename
> them with a .doc, it works great. Can someone help me tweak this? Or give
> me a better method?
>
> Ed
>
> With fs
> .LookIn = strPath & "\MyDocs"
> .FileName = "*.doc" 'for no extension,
> 'I used "*"
>
> If .Execute > 0 Then 'with no extension,
> 'this drops immediately to End If
> For i = 1 To .FoundFiles.Count
> MsgBox .FoundFiles(i)
> strName = .FoundFiles(i)
> strFName = Right(strName, Len(strName) - 9)
> MsgBox strFName
> FileCopy strName, strFolder & strFName
> Next i
> End If
> End With
>
>
>

Re: Help with App.FileSearch object, please? by Ed

Ed
Tue Oct 26 11:25:07 CDT 2004

Hi, Pete. Not stupid at all - I've been caught by things just like that.
But yes, I did try it - but there's no . in the name at all. I did get
something that worked:

Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder _
(strTIRs)
If Not objFolder Is Nothing Then
For Each objFile In objFolder.Files
With objFile
strName1 = .Name
FileCopy strTIRs & "\" & strName1, strFolder & "\" &
strName1
End With
Next
End If

"Pete Bennett" <PeteBennett@discussions.microsoft.com> wrote in message
news:EF6B2771-7BE9-483D-ADBF-F2391ADCE617@microsoft.com...
> Might be a stupid question, but have you tried using "*.*" as your search
> filter?
>
> "Ed" wrote:
>
> > I'm trying to loop through the files in a folder to use FileCopy. The
files
> > have no dot-extension suffix, and FIleSearch can't see them. If I
rename
> > them with a .doc, it works great. Can someone help me tweak this? Or
give
> > me a better method?
> >
> > Ed
> >
> > With fs
> > .LookIn = strPath & "\MyDocs"
> > .FileName = "*.doc" 'for no extension,
> > 'I used "*"
> >
> > If .Execute > 0 Then 'with no extension,
> > 'this drops immediately to End
If
> > For i = 1 To .FoundFiles.Count
> > MsgBox .FoundFiles(i)
> > strName = .FoundFiles(i)
> > strFName = Right(strName, Len(strName) - 9)
> > MsgBox strFName
> > FileCopy strName, strFolder & strFName
> > Next i
> > End If
> > End With
> >
> >
> >