Framework EDI Reference. Methods and Properties
mailBody.Import

Imports the content of an external file into the body overwriting the existing content.

Syntax:

Parameters:

Returns:

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

Remarks:

Any existing data in the body is erased without warning and the data of the body will contain the contents of the imported file.

Example:

Dim oEdiDoc As Fredi.ediDocument
Dim oMailDocument As Fredi.mailDocument
Dim oSubMsg As Fredi.mailMessage
Dim oBody As Fredi.mailBody

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

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

' Load EDI document normally.
oMailDocument.Load App.Path & "\SampleMail.TXT"

' Get subject message
Set oSubMsg = oMailDocument.GetMessage

' Get subject message body
Set oBody = oSubMsg.GetBody

' Import body content from an external file.
oBody.Import App.Path & "\BodyAlternate.TXT"

' Save document.
oMailDocument.Save App.Path & "\Output.TXT"

MsgBox "Done"

Samples