Framework EDI Reference. Methods and Properties
mailMessage. PutMsgString

Builds the entire the message internally by concatenating strings to an internal string that represents the message.

Syntax:

Parameters:

Returns

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

Remarks

The PutMsgString method allows the ability to load a message as a string.  The method builds on an internal string by concatenating the sub string passed to the method in one of a series of multiple sequential calls to the method that builds the message.  Or if possible, pass the entire string representation of the message in a single call.  The internal string is then processed when the Prepare method is invoked. 

The internal string remains in the message and is used as the content to process when the message is prepared using the Prepare method.  The existing headers, body and sub messages are overwritten, and the internal string is then cleared. 

The internal string is also cleared when the Erase method is called.

 

Example

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

sMsg = "Date : 27 Aug 76 09:32 PDT" & vbCrLf
sMsg = sMsg & "From : Ken Davis <KDavis@This-Host.This-net>" & vbCrLf
sMsg = sMsg & "Subject : Re: The Syntax in the RFC" & vbCrLf
sMsg = sMsg & vbCrLf
sMsg = sMsg & "This is the body of this mail which must be separated from the" & vbCrLf
sMsg = sMsg & "headers by a NULL line." & vbCrLf

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

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

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

' Put string in message.
oMessage.PutMsgString sMsg

' Prepare to apply changes.
oMessage.Prepare

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

MsgBox "Done"

Samples