It does give me some more of an idea of how to approach the files in the Listbox, but I am still not all the way there. This is what I would really like the program to do in the end:
1) the program automatically (without a "remove" button) recognises the filename "20001001.dwg", and removes it from the listbox before the listbox is shown.
2) This 20001001.dwg "stringfilename" is then stored in the memory so it will be used to save info on the rest of te files (make a drawinglist).
The part of my form that collects the file info looks like this:
Code:
Private Sub CommandGetList_Click()
Dim FolderName As String
Dim frm As New ProjectDrawings
MsgBox ("Select the map of the project")
FolderName = ShowDialog2()
If FolderName <> vbNullString Then
Dim colDirList As New Collection
Dim varItem As Variant
' "dwg" for autocad files...
Call FindFiles1(colDirList, FolderName, "dwg", True)
' Add files to the form.
For Each varItem In colDirList
frm.ListBoxTwo.AddItem (varItem)
Next
' Select all files in the form
If frm.ListBoxTwo.ListCount > 0 Then
For i = 0 To frm.ListBoxTwo.ListCount - 1
frm.ListBoxTwo.Selected(i) = True
Next
End If
' Show form in wich some files can be left unselected so they aren 't processed
frm.Show
End If
End Sub
Perhaps (as you have been of good help so far) you can help me find a way of making that selection process work automatically?