I am in need to zip folders using a VB6 app. I have the folders created but
I need to compress them into a zip file programically. Does anyone have any ideas on how to do this??
Thanks in advance for your help
Nate
Printable View
I am in need to zip folders using a VB6 app. I have the folders created but
I need to compress them into a zip file programically. Does anyone have any ideas on how to do this??
Thanks in advance for your help
Nate
A search of CodeGuru would have turned up this gem. :)
How To Zip And Unzip In VB
Thanks I should of searched first. I saw this a couple of min before you replied. Thanks again. :thumb:
This is a follow up to my early post. I am still having problems zipping folders. I can zip all files in a given dir but can not get sub folders to be included in the zip. Does anyone know what I am missing? Here is my code:
Dim oZip As CGZipFiles '
Set oZip = New CGZipFiles
oZip.ZipFileName = "C:\Temp\Request\MyZip.Zip"
oZip.AddFile "C:\Temp\Request\PR006454\*.*"
If oZip.MakeZipFile <> 0 Then
MsgBox oZip.GetLastMessage
End If
Set oZip = Nothing
This should work when reading the notes in the documentation 'How to Zip and Unzip in VB'Quote:
Originally Posted by Nate Hunter
( I have got it working if the directory is the App.path but still problems if oZip.RootDirectory isn't App.path )
Jonny Poet :wave:
thanks for the reply. You are right I can get the code posted previously to work with the App.path. I can use this but I would like to remove the app from the zip. I tried:
oZip.RemoveFile "Project1.exe"
with no luck. any Ideas how I can get this file out of my zip file.
Thanks again.
I'm frightened in between, that there are bugs in the dlls. Does anyone have or know where to get the original dlls for debug ? In the different notes regarding that articel you see exactly this problems coming up:Quote:
Originally Posted by Nate Hunter
1) You Cannot delete.
2) If its given fullpath in oZip.AddFile fullpathstring then you cannot
add subdirectories to even when you set oZip.RecurseFolders = True
You have to use: oZip.RootDirectory in this case. But if doing so then
3) you didnt get zipped the folder you want, app.path files are zipped !
So the solution is : :D Lets get the dlls source and repair it. That should work, isn't it ?
I had the same what an application I'm making. It is indeed not possible to zip the contents of another folder than the app.path folder. This is a bug, I presume?
The .RecurseFolders = True is working, but useless when only the application folder, including its subfolders, is zipped.
Please anuone who can repair this.
BTW, should the ZIP 3.0 beta do it better?
Regards,
Jaap
As far as I know, the CGZip and CGUnzip classes base on the dlls Zip32.dll and Unzip32.dll
Personally I have used Unzip32.dll but had written an own wrapper function 'cause I didn't need all that class overhead. I found the dll itself working without errors.
Since you can get the source of the wrapper classes, you should study this and determine if the errors are produced in the VB-class or if they reside in the dll Zip32.dll itself. The function Zip32.dll provides may seem a little complicated but perhaps it behaves alright if you call the Zip function directly.
Windows XP zips by default, plus you can make a zip file yourself. Download a Microsoft DOCX format file, and open it. It's a zip file as well.
There is a link here on zipping files, have a look!
jagio, please do not revive old threads.
Rather start a new thread, and refer to the old thread.
Just stumbled into this, could be handy.
Just make sure you saw this:
Quote:
'Apparently you can only shell WinZip in vbHide mode if you have licensed
'WinZip. If you are using the evaluation version, you need to run the shell in
'vbNormalFocus mode. Then WinZip displays a message saying it is running in
'evaluation mode and you must press a key to continue.