Erases the contents of the message.
Syntax:
Returns
Returns 1 if the operation is successful; otherwise returns 0 if the operation fails.
Remarks
The message basically consists of the following, and are erased as follows:
- Headers. The list of headers already created are removed.
- Body. The entire contents are deleted.
- Messages. Collection of sub messages or body parts are removed.
The internal text used to build the message internally, if any, is also cleared.
NOTE: Configurations previously set for the message remain the same and are not reset or changed to the default values.
Example
Dim oEdiDoc As Fredi.ediDocument
Dim oMailDocument As Fredi.mailDocument
Dim oMessage 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.
oMailDocument.Load App.Path & "\SampleMail.TXT"
' Get top level message of the document.
Set oMessage = oMailDocument.GetMessage
oMessage.Save App.Path & "\OriginalOutput.TXT"
' Erase contents
oMessage.Erase
oMessage.Save App.Path & "\EmptyOutput.TXT"
MsgBox "Done"
Samples