I have a directory where I store the latest version of various PDF files. The files are moved to this directory via the FileCopy function. I am having a problem where if a file exists in the latest version directory (ie: c:\latest_files\file1.pdf) and a newer version is created (c:\file1\file1.pdf), the FileCopy function is not overwriting the file in the latest version directory. I know that I can always delete the file in the latest version directory and then copy the newer version over, but I would prefer if FileCopy would overwrite the file. Is there any way to do this?
Code:
strWEBPATH2 = PADIRECTORY + "PA" + strTitleNumber + ".pdf"
If funValidFileName("PA" + strTitleNumber + ".pdf") Then
'Copy Files
FileCopy SOURCEDIRECTORY + sNextFile, strWEBPATH2
End If 'End check for valid file names