Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

zipping a folder not a single file 1

Status
Not open for further replies.

jenohagen

Programmer
Mar 25, 2008
14
US
Hello,
I have to grab a folder (I already have a function to browse for the folder) and zip all the contents in that folder to a zip file. I have found a way to zip one file in the folder but not to make one zip file that contains all of the files in that folder. Does anyone have any ideas to do this?

Jeno
 
Show us how you are zipping the single file, and we'll go from there ...
 
Tony

sorry, but I favor Tek-Tips and strongm! [wink]

thread222-1302498
 
Jerry,

Are you saying there is something wrong with Ron's code? I haven't looked at it myself; I just knew it existed and I trust Ron until I'm told there's a problem, in which case I'll pass it on.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 

No! Just there is a saying in my native languange that says "If you don't euphimize your home it's gonna fall and weight down on you!"


 

But I have a question. If you use WinZip or other programme to zip, would this built-in functionality still work? I 'm experiencing a problem in line

.NameSpace(strZipName).CopyHere strFile

with
?err.Description
Method 'NameSpace' of object 'IShellDispatch4' failed
Is there a cure?
 
The page I linked to is for using Windows built-in compression. Near the top of it there are links to other pages for using WinZip.


Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Tony

I did see those, but what if I want Windows built-in compression back? Since user with WinZip has to use different piece of code than non-Winzip user?
 
Sorry, I don't know. It must be possible to determine whether or not Winzip is installed but I don't know if there's another way. I will see if I can find out.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 

Winzip might be installed if the .exe exists! That's not the problem. I'm looking for a way to unistall WinZip and gain back built-in compression which seems to be gone! Compressed zipped Folder is missing from my Send To context menu on WinXP Pro sp2 box.
 
I am currently using access but here is the code i have so far. The function for zipping is passed only one file and file path. It then zips the file. So if i have mulitple files I of course will have multiple zips. It would be much easier to just zip the whole folder. I am now going to the site that TonyJollans recommended and found the examples there. I am going to try it.

Function G_Zip(Files, ZipFileName_Path)
Dim ResultCode As xcdError, A, FileImages(10)

Dim XceedZip1 As XceedZip
Set XceedZip1 = New XceedZip
Call XceedZip1.license("ZIP60-DZ7CT-H74CJ-XXXX")'I have Changed the license
XceedZip1.FilesToProcess = Files
XceedZip1.ZipFileName = ZipFileName_Path ' "E:\Group A\Access\DealPack App\DealPack Image\Image.zip"
' Start zipping
ResultCode = XceedZip1.Zip
' Check the return value.
If ResultCode <> xerSuccess Then
MsgBox "Unsuccessful. Error # " & str(nErr) & " occurred. Description: " & XceedZip1.GetErrorDescription(xvtError, ResultCode), vbOKOnly, "Deal Pack"
Else
'MsgBox "File(s) successfully zipped.", vbOKOnly, "Deal Pack"
End If
 
>gain back built-in compression

regsvr32 %windir%\system32\zipfldr.dll
 

Now, you see why????
Thanx man!Have a star for saving me, once again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top