Results 1 to 3 of 3

Thread: Saving selected items from a listbox to a text file

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    UK
    Posts
    66

    Post

    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

  2. #2

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    UK
    Posts
    66

    Post

    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
  •  



Click Here to Expand Forum to Full Width