You should also use:

 Destination = SaveFolder.Child(Filename)

As I learned from Joe before absolutepath should be avoided if possible. I use to have problems with the string getting truncated when it was to long.

-Drew

On Feb 17, 2007, at 5:34 PM, RBNUBE wrote:

I'm not sure what's causing your problem, but instead you might try
something like this:

  Dim i, rowCount as Integer
  Dim FilePath, FileName as String
  Dim SaveFolder as FolderItem

  rowCount  =  SearchList.ListCount - 1
SaveFolder = GetFolderItem("<PATH TO YOUR DESKTOP>\SOURCE \DESTINATION")

  For i  =  rowCount DownTo 0

    If SearchList.CellCheck(i,0) = True then

      FilePath = SearchList.Cell(i,2)
      FileName = SearchList.Cell(i,1)
      Source = getFolderItem(FilePath)
      Destination = GetFolderItem(SaveFolder.AbsolutePath + Filename)

      Source.CopyFileTo Destination

    End if

  Next

Please note that paths are generally frowned upon. In fact, almost always. I've learned the hard way that relying on them, even on Windows, can cause
you grief.

A better way might be to use CellTags. Instead of relying on the path in the second column, add the path to the column as a visual representation of where the file is and store a reference to the actual file in the CellTag of the second column. CellTags are wonderful things that allow you to store
variants in the ListBox.

ListBox1.AddRow ""
ListBox.Cell(ListBox1.LastIndex, 2) = File.AbsolutePath
ListBox.CellTag(ListBox1.LastIndex, 2) = File

Then, change the main code:

  FilePath = SearchList.Cell(i,2)
  FileName = SearchList.Cell(i,1)
  Source = getFolderItem(FilePath)
  Destination = GetFolderItem(SaveFolder.AbsolutePath + Filename)

To:
      Source = SearchList.CellTag(i, 2)
      Source.CopyFileTo SaveFolder

Also, SaveFolder does not/should not have to be based on a path...

HTH


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to