Gets the length of the body in decimal number of bytes (or octets).
Syntax:
<lCount> = object.Length
Remarks:
This property returns the total number of bytes (or octets) in the message body. Because the data is stored as binary, special characters are counted even if the message has been defined as text.
Please note:
- Carriage-return line-feed pair (CRLF) is counted as two characters.
- Any occurrence of NULL (or octet with value 0) before the end of data is counted as one. The length does not terminate at the first occurrence of NULL even if the message has been defined as text.
- For composite media type messages, i.e. messages having Content-Type of "multipart" or "message", this property will return zero.
Example:
Dim oEdiDoc As Fredi.ediDocument
Dim oMailDocument As Fredi.mailDocument
Dim oSubMsg As Fredi.mailMessage
Dim oBody As Fredi.mailBody
' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument
' Get internet mail document object
Set oMailDocument = oEdiDoc.GetMailDocument
' Load EDI document normally.
oMailDocument.Load App.Path & "\SampleMail.TXT"
' Get subject message
Set oSubMsg = oMailDocument.GetMessage
' Get subject message body
Set oBody = oSubMsg.GetBody
MsgBox "Length: " & oBody.Length
Samples