Evening,
How do I copy all the files that I have in a listbox to another directory? Without FileSystemObject.....
The files could number anywhere from 1- 1000.
Any help would greatly appreciated.
Mike
Printable View
Evening,
How do I copy all the files that I have in a listbox to another directory? Without FileSystemObject.....
The files could number anywhere from 1- 1000.
Any help would greatly appreciated.
Mike
If the listholds files with complete path then you can do something like this:
------------------Code:Dim i As Integer
For i = 0 List1.ListCount - 1
FileCopy List1.List(i), "C:\MyDirectory"
Next
Serge
Senior Programmer Analyst
[email protected]
[email protected]
ICQ#: 51055819
Serge,
Here is the code leading up to the filecopy to dir. code.
[/code]
Dim Listlen As Integer '
Dim cnr As Integer 'variables for progress bar
Dim mylen As Integer '
Listlen = (List2.ListCount) '
For cnr = 0 To Listlen - 1 '
Form4.Show
Form1.Hide
Form4.Label1.Caption = cnr + 1
Form4.Label3.Caption = List2.ListCount
Form4.ProgressBar1.Max = List2.ListCount
Form4.ProgressBar1.Value = cnr + 1
Dim Translation As String
Dim DirTrans As Boolean
Translation = Dir1.Path & "\Translation\"
If Dir(Translation) = "" Then
MkDir Translation
DirTrans = True
Else
ChDir Dir1.Path & "\Translation\"
DirTrans = True
End If
Dim i As Integer[/code]
As you can see I need to move it from is current location to the "\translation\" directory.
What do I need to finish it.
Mike