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...
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...
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