Drop .txt onto a listbox?

Hi,
Does anyone know if it is possible to drop a text file onto a listbox, and have it’s filename inserted into database column 0, and its content inserted into column 1?

Any pointers would be greatly appreciated :slight_smile:

ListBox.Open

me.AcceptFileDrop("")

ListBox.DropObject

   dim mystring as String
  dim tis as TextInputStream
  if obj.FolderItemAvailable then
    if right (obj.FolderItem.Name, 4) = ".txt" then
      tis = TextInputStream.Open(obj.FolderItem)
      mystring = tis.ReadAll
      lb.AddRow
      lb.Cell(lb.LastIndex, 0) = obj.FolderItem.Name.Replace(".txt", "")
      lb.Cell(lb.LastIndex, 1) = mystring
    end if
  end if

Thank you very much Axel - very much appreciated :slight_smile: