Framework EDI Reference. Methods and Properties
mailMessage. Import

Imports the contents of an external file to the body of the message.

Syntax:

Parameters:

Returns

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

Remarks

This method imports the entire contents of a file, and overwrites any existing data in the body of the message.  The headers and sub messages, if they exist, are not modified.

 

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oMailDocument As Fredi.mailDocument
Dim oMessage As Fredi.mailMessage

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

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

' Load the mail document
oMailDocument.Load App.Path & "\SampleMail.TXT"

' Get top level message of the document.
Set oMessage = oMailDocument.GetMessage

' Import file contents to message body.
oMessage.Import App.Path & "\Import.X12"

oMessage.Save App.Path & "\Output.TXT"

MsgBox "Done"

Samples