Results 1 to 4 of 4

Thread: import file names

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    2

    import file names

    I want to import all the file names in a folder into a listbox. I want to do it without any user input and the number of files will vary.

    Any ideas?

    Sam

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: import file names

    Welcome to the forums.

    Using what?

    VB6?
    VB.NET?
    Something else?

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    2

    Re: import file names

    Ah, VB 6.0. Sorry :-)

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: import file names

    This was just asked last week:
    VB Code:
    1. Private Sub Form_Load()
    2. Dim s As String
    3.  
    4.   s = Dir("E:\VB\*.*") 'whatever path you want
    5.   Do While s > ""
    6.     List1.AddItem s
    7.     s = Dir
    8.   Loop
    9.  
    10. End Sub
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

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