Call ListFiles("C:/files", , , Me.lstFileList) 'function contained in module
'MsgBox Me.lstFileList.RowSource
Dim strTest As String
Dim strArray() As String
Dim intCount As Integer
strTest = Me.lstFileList.RowSource
strArray = Split(strTest, ";")
Me.lstFileList.RowSource = ""
Me.lstFileList.ColumnCount = 3
Me.lstFileList.ColumnWidths = "0cm;2.1cm"
Dim justfilename As String
Dim WrdArray() As String
Dim newrowsource As String
newrowsource = ""
For intCount = LBound(strArray) To UBound(strArray)
'Debug.Print Trim(strArray(intCount))
'MsgBox Right(Trim(strArray(intCount)), InStrRev(Trim(strArray(intCount)), "\"))
If Trim(strArray(intCount)) <> Chr(34) Then
justfilename = Right(Trim(strArray(intCount)), Len(Trim(strArray(intCount))) - InStrRev(Trim(strArray(intCount)), "\"))
WrdArray() = Split(justfilename, "§")
Dim scandate As String
scandate = dateencrypt(Right(WrdArray(0), 2) & "/" & Mid(WrdArray(0), 5, 2) & "/" & Left(WrdArray(0), 4), False)
'Me.lstFileList.AddItem (Trim(strArray(intCount)) & ";" & scandate & ";" & encryptstr(Left(WrdArray(2), Len(WrdArray(2)) - 5), False))
If newrowsource = "" Then
newrowsource = (Trim(strArray(intCount)) & ";" & scandate & ";" & encryptstr(Left(WrdArray(2), Len(WrdArray(2)) - 5), False))
Else
newrowsource = (Trim(strArray(intCount)) & ";" & scandate & ";" & encryptstr(Left(WrdArray(2), Len(WrdArray(2)) - 5), False)) & ";" & newrowsource
End If
End If
Next
Me.lstFileList.RowSource = newrowsource