D
DP
2-3 years ago, someone helped me to adjust the code below by using - as I
recall - some kind of internal additional code (bubble array?) so that the
file names would be "read" in the exact order in which they show up in a
usual Windows Explorer or MyComputer window.
The problem is that my files are all numbers, like this:
5-1-5.tif
5-6-10.tif
etc.
When I have something like 5-11-15.tif
I end up in such cases with this kind of sort:
5-1-5.tif
5-11-15.tif
5-6-10.tif
The "second set" of digits after the first "x-" or, in this case, "5-1," are
page numbers of documents. This is why it's imperative that the files stay
in sequence, and the Lookin code by itself will not do this.
Can someone help me with some kind of internal - I believe it is - "bubble
array?"
Or some other approach?
Thank you, David Pike
_______________________
With fs
.lookin = "C:/xxxxxx/xxxxxx/"
.FileName = "*.tif"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
'MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
'MsgBox .FoundFiles(i)
il.LoadFromFile .FoundFiles(i), 0, 0, 1
Next i
Else
MsgBox "There were no files found."
End If
End With
recall - some kind of internal additional code (bubble array?) so that the
file names would be "read" in the exact order in which they show up in a
usual Windows Explorer or MyComputer window.
The problem is that my files are all numbers, like this:
5-1-5.tif
5-6-10.tif
etc.
When I have something like 5-11-15.tif
I end up in such cases with this kind of sort:
5-1-5.tif
5-11-15.tif
5-6-10.tif
The "second set" of digits after the first "x-" or, in this case, "5-1," are
page numbers of documents. This is why it's imperative that the files stay
in sequence, and the Lookin code by itself will not do this.
Can someone help me with some kind of internal - I believe it is - "bubble
array?"
Or some other approach?
Thank you, David Pike
_______________________
With fs
.lookin = "C:/xxxxxx/xxxxxx/"
.FileName = "*.tif"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
'MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
'MsgBox .FoundFiles(i)
il.LoadFromFile .FoundFiles(i), 0, 0, 1
Next i
Else
MsgBox "There were no files found."
End If
End With