Results 1 to 2 of 2

Thread: Pretty Important Issue: Exporting to Text from a Listbox... how?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    99

    Talking

    How can I export ListBox contents to a text file? Where each Listbox item is on a seperate line in the text file??? Some code would be nice...
    ___________________________
    Chris

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Code:
    Public Sub SaveListBox(lb As ListBox, sFileName As String)
        Dim iFile%, iCount%, i%
        iCount = lb.ListCount - 1
        iFile = FreeFile
        Open sFileName For Output As #iFile
        For i = 0 To iCount
            Print #iFile, lb.List(i)
        Next
        Close #iFile
    End Sub

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