# VB filelistbox



## Veggie (Jun 15, 2003)

Hi, when I use the multiselect property in filelistbox, how do I get the list of files that are selected? I thought it would be in filelistboxObject.list, but the list still has all the files in the directory.. Thank you so much!


----------



## TimCottee (Oct 10, 2001)

```
With filelistboxObject
        For i = 0 To .ListCount - 1 'scan the entire list
            If .Selected(i) Then Debug.Print .List(i) 'if .Selected(i) is true then this item is selected so print out in immediate window
        Next
    End With
```
This is a quick sample to show how you achieve this. You can modify it to take action on each file rather than output the file name quite easily.


----------



## Veggie (Jun 15, 2003)

Hi, thank you, that's what I'm look for! =)


----------

