Sample code for 30+ languages & platforms
Visual Basic 6.0

Unzip Text File to String

See more Zip Examples

Demonstrates how to open a .zip and extract the 1st file (assuming it's a text file) to a string variable.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

' This example requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

Dim zip As New ChilkatZip

success = zip.OpenZip("qa_data/zips/EC16100.zip")
If (success = 0) Then
    Debug.Print zip.LastErrorText
    Exit Sub
End If

' Get the 1st file in the .zip
Dim entry As New ChilkatZipEntry
success = zip.EntryAt(0,entry)
If (success = 0) Then
    Debug.Print zip.LastErrorText
    Exit Sub
End If

Dim fileContents As String
fileContents = entry.UnzipToString(0,"utf-8")
Debug.Print fileContents