On Jul 01, 2006, at 11:21 AM, Craig Hoyt wrote:

I searched the archives and didn't see anything on this. I need to copy the contents of one folder into another. On the chance that a file name might be the same I need to alter the name slightly to make it unique to the destination folder. What is the proper (best) way to do this. The only idea I have is alter the name of the original file, copy, then change the name back to what it was. While this is not a major issue to do this, I'm thinking their might be a better way. Anybody?

See if the destination exists first and if it does alter the destination name
A copy should not touch the originals file name

If you are using folderItem's CopyFileTo method then you need a destination FolderItem anyways

        destFolder = <where ever you are copying to>

        destName = original.Name

        while destFolder.Child(destName).exists
                iteration = iteration + 1
                destName = original.Name + " " + format(iteration,"#")
        wend

        destination = destFolder.Child(destName)


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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to