Framework EDI Reference. Methods and Properties
ediTransports. Count

Returns the total number of transport objects in the collection.

Syntax:

Remarks

Transport objects are added to the ediTransports collection using the CreateTransport method.

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oTransports As Fredi.ediTransports
Dim oTransport As Fredi.ediTransport
Dim oSchemas As Fredi.ediSchemas
Dim oSchema As Fredi.ediSchema

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

' Disable standard reference library.
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.EnableStandardReference = False

' Load the schema that the EDI file will use.
Set oSchema = oEdiDoc.LoadSchema(App.Path & "\ASCX12_850.SEF", Schema_Standard_Exchange_Format)

' Process the EDI file.
oEdiDoc.LoadEdi App.Path & "\SampleEdi.X12"

' Get transports object
Set oTransports = oEdiDoc.GetTransports

' 1. Create a transport object for sending EDI document via HTTP protocol.
Set oTransport = oTransports.CreateTransport
' Set required parameters for the upload.
oTransport.SetHTTP
oTransport.User = "UserID"
oTransport.Password = "password"
oTransport.Address = "www.somehttpsite.com"
oTransport.TargetPath = "/FREDI_TEST/HTTPFiles/"

' 2. Create a transport object for sending EDI document via FTP protocol.
Set oTransport = oTransports.CreateTransport
' Set required parameters for the upload.
oTransport.SetFTP
oTransport.User = "UserID"
oTransport.Password = "password"
oTransport.Address = "www.someftpsite.com"
oTransport.TargetPath = "/FREDI_TEST/FTPFiles/"

' Both transport objects are added to the ediTransports collection.
If oTransports.Count = 2 Then

MsgBox "Transport objects added to the collection"
Else
MsgBox "Failed to add one or more transport objects."
End If

Samples