Aug
28
2003

Zip Extraction Class

Extract Zip archives using the ZLib.dll

Well I've finally put the Zip Extraction Class together. It's got a very simple and somewhat limited interface. Limitations include having to extract all the files in a zip archive and not setting the extracted file's Modify Date to its Modify Date in the archive.

If you declare the ZipExtractionClass in the declerations area of a Class Module or Form using the WithEvents keyword then you gain access to the Status, Progress and Error Events.

Usage

Add ZipExtractionClass.cls to your project and ensure that zlib.dll is reachable

Option Explicit

Private WithEvents zip As ZipExtractionClass

Public sub Unzip

   Set zip = New ZipExtractionClass
   If zip.OpenZip("C:\Test\Test.zip") Then
      If zip.Extract("C:Test\Extract", True, True) Then
         MsgBox "Zip files extracted successfully", vbInformation
      End If
      zip.CloseZip
   End If
   Set zip = Nothing

End Sub

Downloads

  ZipExtractionClass.zip - contains: ZipExtractionClass.cls, Appnote.txt, ZLib.dll (45.0 kb)

  ZipProject.zip - contains: A sample project using the ZipExtractionClass (60 kb)

Links

The ZLib home page where you'll find the ZLib.dll: www.zlib.org

The PKZip File Format: www.pkware.com

More...