Framework EDI Reference. Methods and Properties
ediFile. DecodeToFile

Decodes the contents of the file to a target file.

Syntax:

Parameters:

Returns

Returns 1 if the operation is successful; otherwise returns 0 if the operation fails.

Remarks

There is no check made as to whether the file has been previously encoded or not; FREDI will assume the contents of the file to be already encoded.  If the file has not been previously encoded, the decoding operation can return as successful but the resulting target file can contain garbage data.  Also, the same encoding mechanism used to encode the file must be used to decode, otherwise the resulting target file can contain garbage data.

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.
Set oFile = oFileSystem.GetFile(App.Path & "\EncodeBase64.TXT")

oFile.DecodeToFile EncodeType_Base64, App.Path & "\DecodeBase64.TXT"

MsgBox "Done"

Samples