Framework EDI Reference. Methods and Properties
ediTransport. Receive

Receives a file based on all the receiving parameters specified in the transport object.

Syntax:

Parameters:

Returns

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

Remarks

The receive operation first downloads the file and then immediately processes it.  When receiving, the file is generated internally and is not saved to an external file.  After downloading has completed, the internally generated file is then processed immediately as a document.  To use the downloaded file externally, use the Save method in the ediDocument interface to export the document to an external file once it has been downloaded and processed.

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oTransports As Fredi.ediTransports
Dim oTransport As Fredi.ediTransport

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

' Get transports object
Set oTransports = oEdiDoc.GetTransports

' Create single transport object for receiving document.
Set oTransport = oTransports.CreateTransport

' Set required parameters for the download.

'FTP
oTransport.SetFTP
oTransport.User = "username"
oTransport.Password = "password"
oTransport.Address = "555.555.555.555"
oTransport.TargetPath = "inbound"
oTransport.Receive "850.X12"

' Document already downloaded and processed at this point. Save document
' to file.
MsgBox oEdiDoc.GetEdiString

MsgBox "Done"

Samples