Results 1 to 3 of 3

Thread: [RESOLVED] FileList VBA

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    736

    Resolved [RESOLVED] FileList VBA

    Hi guys
    i am guessing i cant have what i want as most of the similar topics in this forum all point to Dialogopen but i was hoping to populate a listbox with a precoded folders filelist. any ideas?

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: FileList VBA

    VBA, not VB6? If the version of VBA offers a FileList control, you can use that. Set the path and pattern properties, as needed, during runtime. Otherwise, you can use the Dir$() function -- think it is in all VBA versions. Populate a normal listbox with the results:
    Code:
    Dim sFile As String
    sFile = Dir$("[path]\*.*", vbNormal Or vbHidden Or vbSystem or vbReadOnly or vbArchive)
    Do Until sFile = ""
        List1.AddItem sFile
        sFile = Dir$()
    Loop

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    736

    Re: FileList VBA

    \o/ thanks

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