>I'm using the following code to iterate through files in a folder and copy or move them based on certain properties of the files:
>
Dim oFso As New Scripting.FileSystemObject, oFile As Scripting.File
>For Each oFile In oFso.GetFolder(lcFolder).Files
> 'oFile.Copy or oFile.Move here
>Next
>Why is that this works:
>
oFile.Copy (lcDestination1)
>but this does
not:
>
oFile.Copy (lcDestination1,True
Try oFile.Copy lcDestination1, True
>and how do I get oFile.Move to overwrite files?
>
You don't; Move simply changes which folder has the file entry in it; no actual copying takes place. It can't move a file or folder name in conflict with an existing fole or folder name in the destination. The FSO's MoveFile docs method discuss the situation in some detail; File.Move is doing the same thing as the FSO.MoveFile method, except it takes it's source as the current object.
If you want to Move something, you have to ensure the name is not already in use in the target folder; the docs are very explicit.