Hi Aaron,
I was just adding this as I had mentioned it to Dave. Using just the file
name. But, as you say, an item number would also work, but the name seems to be
the best unless he wants the file object itself. Don't know what he was using
it for, but the file name seems to be the best choice.
My Fix:
Function ChooseFile()
Dim FileList: Set FileList = SO_SimpleDialogs.ListBoxDialog
For Each File In FilesDir.Files
OLD: If LCase( File.Name )<> "index.dat" Then FileList.AddItemFile.Name,
File
Fix: If LCase( File.Name )<> "index.dat" Then FileList.AddItemFile.Name,
File.Name
Format: FileList.AddItemDisplayName, Data
So: data is what gets assigned and since it is a file object, thus the need
for set.
Next '
FileList.Sort = True
FileList.DefaultButton = "Delete"
FileList.CancelButton = "Close"
ChooseFile = FileList.ChooseItem( "Files found:" )
End Function
MsgBox ChooseFile