Processes EDI data in a MIME message.
Syntax:
Returns:
Returns 1 if the operation is successful; otherwise returns 0 if the operation fails.
Remarks:
The message must, at a minimum, conform to the following:
- The message follows the basic header-body structure, with a single body.
- The body contains the EDI document.
- The "Content-Type" header has one of the following value:
- Application/EDI-X12
- Application/EDIFACT
- Application/Consent
Example:
Dim oEdiDoc As Fredi.ediDocument
Dim oSchemas As Fredi.ediSchemas
Dim oSchema As Fredi.ediSchema
Dim oMailDocument As Fredi.mailDocument
Dim oMessage As Fredi.mailMessage
' 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)
' Get internet mail document object
Set oMailDocument = oEdiDoc.GetMailDocument
' Disable auto-processing so that message can be read as is.
oMailDocument.Option(MailDocOpt_Auto) = 0
' Load the mail document
oMailDocument.Load App.Path & "\SampleEdi.MIME.TXT"
' Get the message.
Set oMessage = oMailDocument.GetMessage
' Process EDI message.
oMessage.ProcessEdi
oEdiDoc.Save App.Path & "\Output.TXT"
MsgBox "Done"
Sample
See Also.