Framework EDI Reference. Methods and Properties
mailMessage. GetMessages

Gets the collection of sub messages or body parts containing in the message.

Syntax:

Returns

If successful, an object of FREDI.mailMessages is returned; otherwise an empty result is returned.

Remarks

A message generally contains only headers and a single body.  Only composite type messages (content-types: multipart/* or message/*) contain sub messages or body parts.

 

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oMailDocument As Fredi.mailDocument
Dim oMessage As Fredi.mailMessage
Dim oMessages As Fredi.mailMessages
Dim oFirstBody 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 containing the EDI data.
oMailDocument.Load App.Path & "\SampleMail.TXT"

' Get the top message.
Set oMessage = oMailDocument.GetMessage

' Get the collection of sub messages of the message
Set oMessages = oMessage.GetMessages

' Get the first body.
Set oFirstBody = oMessages.GetMessage(1)

' Modify the text.
oFirstBody.BodyText = "The quick brown fox jumps over the lazy dog" & vbCrLf

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

MsgBox "Done"

Samples