But also - when I cursor over the word "Name" is shows me the name of the Form. This isn't right , is it ?
No, It's not right but we dont know where your dn and Files(i) is coming from. They should be paths.
Personally I like fso for copying, moving, renaming, etc., files and folders.
Code:
Public Sub fFileCopy(SourceF As String, DestinationF As String, Optional OvrWrite As Boolean = True)
'Dim fso As New FileSystemObject 'Early Bound- need refernce to MS Scripting runtime
Dim fso As Object 'Late Bound
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile SourceF, DestinationF, OvrWrite
Set fso = Nothing
End Sub
Public Sub fFileMove(SourceF As String, DestinationF As String)
'Dim fso As New FileSystemObject 'Early Bound- need refernce to MS Scripting runtime
Dim fso As Object 'Late Bound
Set fso = CreateObject("Scripting.FileSystemObject")
fso.MoveFile SourceF, DestinationF
Set fso = Nothing
End Sub
Cant say that I understand your code but it looks like you're looking for files with no extension.
fso also has a method to get the file extension
Code:
Function fGetExtension(sPath As String) As String
'Dim fso As New FileSystemObject 'Early Bound- need refernce to MS Scripting runtime
Dim fso As Object 'Late Bound
Set fso = CreateObject("Scripting.FileSystemObject")
fGetExtension = fso.GetExtensionName(sPath)
Set fso = Nothing
End Function
You can also use fso to recursively iterate through directories and subfolders to get all the files within. I don't have any sample code handy for that at the moment but there's plenty around.