Search Tools Links Login

Save / Write contents of a listbox to a textfile


Save /Write contents of a listbox to a textfile

Original Author: Marcel Wijnands

Inputs

output filename and listbox name

Assumptions

Usage:
ListBox2File "c:yourfile.txt", ListBox1

Code

Public Sub ListBox2File(sFile As String, oList As ListBox)
Dim fnum, x As Integer
Dim sTemp As String
fnum = FreeFile()
x = 0
Open sFile For Output As fnum
  While x <> oList.ListCount
   Print #fnum, oList.List(x)
   x = x + 1
  Wend
Close fnum
End Sub
'Check out http://www.vb2delphi.com for more code!

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 78 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.