Framework EDI Reference. Methods and Properties
mailMessage. HeaderFieldValue

Sets or gets the field value of a message header.

Syntax:

Parameters:

Remarks

Comparisons of header names are not case sensitive.

If the header does not already exist, it will be added.

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oMailDocument As Fredi.mailDocument
Dim oMessage As Fredi.mailMessage
Dim sHeaderValue 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.
Set oMessage = oMailDocument.GetMessage

' Get value of header.
sHeaderValue = oMessage.HeaderFieldValue("From")
' Dump to debug window.
Debug.Print sHeaderValue

' Change the value of the header. Syntax must be correct otherwise
' the modification will not be accepted.
sHeaderValue = "somebody <somemail@some.domain.com>"
oMessage.HeaderFieldValue("From") = sHeaderValue

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

MsgBox "Done"

 

Samples