Results 1 to 3 of 3

Thread: Adding large number of files [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Resolved Adding large number of files [RESOLVED]

    Back again. I want to add files to a directory but at present can only add about five and dont know why.

    here is the code Im using

    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3.     Dim i As Integer
    4.  
    5.     ProgressBar1.min = 0
    6.     'ProgressBar1.Max = 100
    7.     ProgressBar1.Value = 0
    8.     ProgressBar1.Scrolling = ccScrollingSmooth
    9.  
    10.     Dim strFile() As String, strPath As String
    11.     Dim n As Long, nCount As Long
    12.     On Error Resume Next
    13.     With CommonDialog1
    14.         CommonDialog1.Filter = "MP3 Files|*.mp3"       'Only Show MP3 type files in folder
    15.  
    16.         .Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNLongNames
    17.         .CancelError = True
    18.         .InitDir = "C:\"
    19.         .DialogTitle = "Select File To Add To Playlist"
    20.      
    21.         .ShowOpen
    22.         If Err.Number <> cdlCancel Then
    23.             strFile = Split(.FileName, vbNullChar)
    24.             nCount = UBound(strFile)
    25.             If nCount = 0 Then
    26.                 'Only one file is selected so split up the path and the filename
    27.                 ReDim strFile(1)
    28.                 strFile(0) = Left$(.FileName, InStrRev(.FileName, "\"))
    29.                 strFile(1) = Mid$(.FileName, InStrRev(.FileName, "\") + 1)
    30.                 nCount = 1
    31.             End If
    32.             strPath = strFile(0)
    33.             If Right$(strPath, 1) <> "\" Then
    34.                 strPath = strPath & "\"
    35.             End If
    36.             ProgressBar1.Max = nCount
    37.             For n = 1 To nCount
    38.     If Len(Dir(FAVORITES_FOLDER & strFile(n))) = 0 Then
    39.         FileCopy strPath & strFile(n), FAVORITES_FOLDER & strFile(n)
    40.     End If
    41.     ProgressBar1.Value = n
    42.     ProgressBar1.Refresh
    43. Next
    44.         End If
    45.     End With
    46. End Sub

    thanks
    R
    Last edited by robvr6; Mar 25th, 2005 at 10:03 AM.

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