Zipping Folders
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
# 1 Re: Zipping Folders
A search of dev-archive would have turned up this gem. :)
How To Zip And Unzip In VB ( http://www.dev-archive.com/vb/gen/vb_graphics/fileformats/article.php/c6743/)
Hack at 2007-11-9 20:28:53 >

# 2 Re: Zipping Folders
Thanks I should of searched first. I saw this a couple of min before you replied. Thanks again. :thumb:
# 3 Re: Zipping Folders
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
# 4 Re: Zipping Folders
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\*.*"
oZip.RecurseFolders = True
oZip.RootDirectory = "C:\Temp\Request\PR006454"
oZip.AddFile "*.*"
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'
( 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:
# 5 Re: Zipping Folders
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.
# 6 Re: Zipping Folders
...to work with the App.path. 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:
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 ?