I checked your code and it failed just as you reported.
Then I created an empty mail file manually by running WinZip.
Then I ran your code and it went fine.
It looks like a zip file must already exist for ZipDirectoryContents to work.
To create a zip file programmatically:
myZipFile := TZIpFile.Create; myZipFile.Open('c:\myfolder\newzipfile.zip', TZipMode.zmWrite); myZipFile.Close; myZipFile.Free;
This line will work:
TZipFile.ZipDirectoryContents('c:\myfolder\newzipfile.zip', WorkingDir);
RobertFrank
source share