Results 1 to 6 of 6

Thread: [ RESOLVED...!!! ] I think this too hard for me...

  1. #1

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Thumbs up [ RESOLVED...!!! ] I think this too hard for me...

    I want to load all the files with a .txt extension into combobox...

    So, far I can only choose the folder but can't load the files with .TXT extension into combo box...

    Cheers...
    Last edited by wrack; Jul 8th, 2002 at 03:17 AM.

  2. #2
    Hyperactive Member
    Join Date
    Dec 1999
    Posts
    321
    try looking at the example posted in this thread
    Signed, Rodik ([email protected])
    Programmer,usesVB6ED
    ===========================
    Copyright©RodikCo,2002.

    Dont mind this signature ;] Its old

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: I think this too hard for me...

    Originally posted by wrack
    I want to load all the files with a .txt extension into combobox...

    So, far I can only choose the folder but can't load the files with .TXT extension into combo box...

    Cheers...
    Do you just want to get the names of the files into the combobox ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Thumbs up thats right...!!!!

    yaap plenderj,

    I just want to get the name of all .txt files in combobox...

    Cheers...

  5. #5
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    VB Code:
    1. Private Sub Form_Load()
    2.     Dim myPath As String: myPath = "c:\"
    3.     Dim myName As String: myName = Dir(myPath & "*.txt")
    4.     Combo1.Clear
    5.     Do While myName <> ""
    6.        '' add just name, but with no path :
    7.        ''
    8.        Combo1.AddItem myName
    9.        
    10.        '' or add path AND name
    11.        ''
    12.        'Combo1.AddItem myPath & myName
    13.        
    14.        myName = Dir
    15.     Loop
    16. End Sub
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  6. #6

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Thumbs up This is exactly what I am looking for...

    ThX plenderj...

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