Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MULTIPLE FILENAMES TO LISTBOX 1

Status
Not open for further replies.

MrVB50au

Programmer
Mar 16, 2003
326
AU
Hi Folks,

Below is some code that I've been fiddling with and trying to get a list box to take a group of selected files.

It don't seem to want to work and keep getting errors.

Sub MoveSelectedFiles()
FileListBox.ListIndex = 0
ListBox.Clear
For i = 0 To FileListBox.ListCount - 1
FileListBox.ListIndex = i
If FileListBox.Selected = True Then
ListBox.AddItem FileListBox.Filename
End If
Next i
End Sub

Can you please help?

Thanks in advance,

Andrew.
 
where does the error point to???

Known is handfull, Unknown is worldfull
 
Try this instead:
Sub MoveSelectedFiles()
ListBox.Clear
Dim i As Integer
For i = 0 To FileListBox.ListCount - 1
If FileListBox.Selected(i) = True Then
ListBox.AddItem FileListBox.List(i)
End If
Next i
End Sub

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Now that worked great!

Thanks DrJavaJoe,

Very Very Much Greatful,

Andrew.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top