mugcy
06-30-2009, 02:48 AM
Hi,
I've been writing some code on Excell VBA to copy particular file from a zip folder to a new folder using the following code bit
Set oApp = CreateObject("Shell.Application")
For Each fileNameInZip In oApp.Namespace(zipObj).items
zipExt = Right(fileNameInZip, 3)
Zipfilename = Mainfilename(fileNameInZip)
If Zipfilename Like DFTFile Then
'Copy the DFT file to DFT Files Folder
oApp.Namespace(FileNameFolder).CopyHere (fileNameInZip)
'Rename the DFT file as TXT file
'Name FileNameFolder & fileNameInZ being copied alreadyip As FileNameFolder & DFTFile & ".txt"
'Copy the DFT file to the Archive Folder
oApp.Namespace(DFTArchiveFolder & fnm).CopyHere (fileNameInZip)
End If
Next
'Delete the store zip file from ZIP files folder
Kill (zipObj)
sometimes the new folder has the files with the same file name that are extracted from the zip file. I need these files to overwrite the existing files without pressing "yes to All".
I tried using
oApp.Namespace(DFTArchiveFolder & fnm).CopyHere (fileNameInZip) FOF_NONCONFIRMATION
with FOF_NONCONFIRMATION defined as a constant 16. But still it keeps asking for input to overwrite.
can someone pls help me to fix this?
I've been writing some code on Excell VBA to copy particular file from a zip folder to a new folder using the following code bit
Set oApp = CreateObject("Shell.Application")
For Each fileNameInZip In oApp.Namespace(zipObj).items
zipExt = Right(fileNameInZip, 3)
Zipfilename = Mainfilename(fileNameInZip)
If Zipfilename Like DFTFile Then
'Copy the DFT file to DFT Files Folder
oApp.Namespace(FileNameFolder).CopyHere (fileNameInZip)
'Rename the DFT file as TXT file
'Name FileNameFolder & fileNameInZ being copied alreadyip As FileNameFolder & DFTFile & ".txt"
'Copy the DFT file to the Archive Folder
oApp.Namespace(DFTArchiveFolder & fnm).CopyHere (fileNameInZip)
End If
Next
'Delete the store zip file from ZIP files folder
Kill (zipObj)
sometimes the new folder has the files with the same file name that are extracted from the zip file. I need these files to overwrite the existing files without pressing "yes to All".
I tried using
oApp.Namespace(DFTArchiveFolder & fnm).CopyHere (fileNameInZip) FOF_NONCONFIRMATION
with FOF_NONCONFIRMATION defined as a constant 16. But still it keeps asking for input to overwrite.
can someone pls help me to fix this?