Results 1 to 3 of 3

Thread: copy files from a listbox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Location
    Nashville, TN
    Posts
    114

    Post

    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

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Location
    Nashville, TN
    Posts
    114

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width