-
Hi!
I have an application which needs to open a particular
directory, get a file , perform some operation on it and
move it to a different directory, then go to next file
and do the same thing..until the directory is empty.
The user just open's the particular directory and program has to do the rest automatically. Also I want to see the fileOpen dialog box during this process.
Please help.
--Kavitha
-
To establish a list file of a specific directory use this code.
Code:
'search for files in the specified folder
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.getfolder("c:\test")
Set fc = f.Files
For Each f1 In fc
fsubm = fsubm + 1
filess(fsubm) = f1.Name 'define list of files
Next
You will have files(a) the files of your directory (fsubm is the total number of files in the directory)
Then you can just process the files with the Scripting objects to move them.
Hope this helps,
W.
-
Hey Thanks!
But Is it possible to view the files being moved to the other directory ..for eg: in the fileOpen dialog box.
-
Well just use filess(fsubm), which has the name of the file that you are treating...
Sorry I don't have here the move code, hope you can manage.
W.
-
That's not a problem..Thanks.