|
-
Mar 10th, 2000, 05:54 PM
#1
Thread Starter
Lively Member
Hi folks,
I can use the following code to save the entire contents of a listbox to a text file, but I can't work out how to just save the selected items (I have multiselect set to 2).
Any ideas?
Simon
Dim file As String
file = "temp.dat"
On Error Resume Next
Open file For Output As #1
For i = 0 To lstWorkstations.ListCount - 1
a$ = lstWorkstations.List(i)
Print #1, a$
Next
Close #1
-
Mar 11th, 2000, 12:21 AM
#2
Change the loop to
For i = 0 To lstWorkstations.ListCount - 1
If lstWorkstations.Selected(i) Then
a$ = lstWorkstations.List(i)
Print #1, a$
End If
Next
-
Mar 11th, 2000, 01:27 AM
#3
Thread Starter
Lively Member
Thanks Martin - that did the job.
I was trying If lstworkstations.selected(i) = true
Sorted anyway.
Cheers
Simon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|