Results 1 to 4 of 4

Thread: [RESOLVED] list box to .txt file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    131

    Resolved [RESOLVED] list box to .txt file

    hi

    how can i copy all contents of a list box to .txt file

    i need to save each list item in new line
    so it will be as a list in .txt file

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: list box to .txt file

    VB Code:
    1. Dim N As Long
    2. Dim ff As Integer: ff = FreeFile
    3.     Open "c:\test.txt" For Output As #ff
    4.         For N = 0 To List1.ListCount - 1
    5.             Print #ff, List1.List(N)
    6.         Next N
    7.     Close #ff

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    131

    Re: list box to .txt file



    thanks

  4. #4

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