
Adding multiple items from File Box to List box
For i = 0 To File1.ListCount - 1
If File1.Selected(i) then
If Right(Dir1.Path, 2) = ":\" Then
x = Dir1.Path & File1.List(i)
Else
x = Dir1.Path & "\" & File1.List(i)
End If
List1.AddItem x
End If
Next
Lee Weiner
weiner AT fuse DOT net
Quote:
>I have had one heck of a time figuring out the logic for selecting multiple
>files from a File List box and adding them to a regular list box.
>I can add one at a time, but not multiple files
>I use this code:
>For i = 0 To File1.ListCount - 1
>If Right(Dir1.Path, 2) = ":\" Then
> x = Dir1.Path & File1.List(i)
>Else
> x = Dir1.Path & "\" & File1.List(i)
>End If
>List1.AddItem x
>Next
>That adds one at a time just perfectly.
>I've tried:
>Dim I
> For I = 0 To file1.ListCount - 1
> If file1.Selected(I) Then
> list1.additem file1.selected(i)
> End If
> Next I
>(among many other iterations) - but just can't figure it out...
>Can someone give me a little help here?