Framework EDI Reference. Methods and Properties
ediFile. UnzipToFile

Decompresses the contents of the file to a target file.

Syntax:

Parameters:

Returns

Returns 1 if the operation is successful; otherwise the operation returns zero.

Remarks

The same compression method used to compress the file must be used to decompress, otherwise an error is generated.

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oFileSystem As Fredi.ediFileSystem
Dim oFile As Fredi.ediFile

' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument

' Get file system object.
Set oFileSystem = oEdiDoc.GetFileSystem

' Get file object of compressed file.
Set oFile = oFileSystem.GetFile(App.Path & "\ZipFile_ZipInfo.zip")
' Decompress to text file using ZIPINFO
oFile.UnzipToFile CompressMethod_ZipInfo, App.Path & "\Unzip_ZipInfo.TXT"

' Get file object of compressed file.
Set oFile = oFileSystem.GetFile(App.Path & "\ZipFile_ZLib.zip")
' Decompress to text file using ZLIB
oFile.UnzipToFile CompressMethod_ZLib, App.Path & "\Unzip_ZLib.TXT"

MsgBox "Done"

Samples