Adding multiple items from File Box to List box
Author Message
Adding multiple items from File Box to List box

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
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
End If
Next I
(among many other iterations) - but just can't figure it out...
Can someone give me a little help here?
--
David Wier
http://www.*-*-*.com/

Thu, 05 Jul 2001 03:00:00 GMT
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
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
>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
>        End If
>    Next I
>(among many other iterations) - but just can't figure it out...
>Can someone give me a little help here?

Thu, 05 Jul 2001 03:00:00 GMT
Adding multiple items from File Box to List box
Thanks - now I see...it works great.

--
David Wier
http://24.4.49.69
Home of ASP Express - ASP/HTML Text editor for Win95/98/NT
PhoneZ - the Phonebook program for the rest of us.

Quote:

>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
>   End If
>Next

>Lee Weiner
>weiner AT fuse DOT net

>>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
>>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
>>        End If
>>    Next I
>>(among many other iterations) - but just can't figure it out...
>>Can someone give me a little help here?

Thu, 05 Jul 2001 03:00:00 GMT

 Page 1 of 1 [ 3 post ]

Relevant Pages