Framework EDI Reference. Methods and Properties
mailDocument. GetMessage

Gets the subject message of the document.

Syntax:

Returns

If successful return an object of type FREDI.mailMessage, otherwise NULL or empty if the operation failed.

Remarks

The mailDocument object consists of two messages: the subject message and the message disposition notification (MDN).  The subject message is the message that gets loaded and generated during normal processing of the message document.

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

Set oSchema = oEdiDoc.LoadSchema(App.Path & "\ASCX12_850.SEF", Schema_Standard_Exchange_Format)

' Load EDI document normally.
oEdiDoc.LoadEdi App.Path & "\SampleEdi.X12"

' Get internet mail document object
Set oMailDocument = oEdiDoc.GetMailDocument

' Load the mail document containing the EDI data.
oMailDocument.PrepareEdi ediDocType_Subject
' Save document
oMailDocument.Save App.Path & "\DocumentOutput.TXT"

' Get the top message.
Set oMessage = oMailDocument.GetMessage
' Save message
oMessage.Save App.Path & "\MessageOutput.TXT"

MsgBox "Done"

Samples