Framework EDI Reference. Methods and Properties
mailMessage. GetHeaders

Gets the collection containing all the headers in the message.

Syntax:

Returns:

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

Remarks:

If the message does not have any header, this method will return a collection that is empty.  That is, it has a count of zero.

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oMailDocument As Fredi.mailDocument
Dim oMessage As Fredi.mailMessage
Dim oHeaders As Fredi.mailHeaders
Dim oHeader As Fredi.mailHeader
Dim sHeadersStr As String

' 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, and get the message.
Set oMessage = oMailDocument.GetMessage

' Get the headers collection of the message.
Set oHeaders = oMessage.GetHeaders

' Get each header in the collection.
For Each oHeader In oHeaders

sHeadersStr = sHeadersStr & vbTab & oHeader.Name & " = " & oHeader.Value & vbCrLf
Next

MsgBox "Message Headers: " & vbCrLf & sHeadersStr

Samples