Hello

I am a beginner VB programmer and I am looking for some suggestions/help in order to dump all the contents of a list box to a txt file.

Open "c:\RSJ_UPDATE.TXT" For Output As #1

Dim n As Integer
n = 0
Dim getlistselection As String
getlistselection = lstdefpath.Text
lstdefpath.ListIndex = n
Do While getlistselection > ""
lstdefpath.ListIndex = n
getlistselection = lstdefpath.Text
Print #1, getlistselection
n = n + 1
Loop


Close filesavedef

The problem is that I cannot get it to LOOP through the contents, it just keeps generating a TXT file with zero size. Any help is appreciated. Thanks.