For zips you can use this `cZipArchive` class (pure VB6, no external/dll dependecies) along w/ `cMemoryStream` sample class from tests to extract files from a zip archive to byte-arrays.
Easiest would be to pass an instance of `cMemoryStream` as `OutputFile` param of `Extract` method on `cZipArchive` like this:
VB Code:
Private Sub Form_Load() Dim oArchive As cZipArchive Dim oStylesStream As cMemoryStream Set oArchive = New cZipArchive Set oStylesStream = New cMemoryStream oArchive.OpenArchive "D:\TEMP\Book1.xlsx" oArchive.Extract vbNullString, "xl\styles.xml", oStylesStream Debug.Print UBound(oStylesStream.Contents) End Sub
A more complicated approach would be to sink `BeforeExtract` event and create/assign instances of `cMemoryStream` to `File` event parameter as needed. These instances have to be appended to a collection to be accessible after extraction.
cheers,
</wqw>




Reply With Quote
