1

Topic: VBA outlook cuts off the letter text

The task:
To write the robot for handling of incoming letters.
That made:
Wrote on VBA a script in outlook'

Private Sub Application_NewMailEx (ByVal EntryIDCollection As String)
Dim arr () As String
Dim i As Integer
Dim ns As Outlook. NameSpace
Dim itm As MailItem
Dim m As Outlook. MailItem
Dim parsedRequest
On Error Resume Next
Set ns = Application. Session
arr = Split (EntryIDCollection ",")
For i = 0 To UBound (arr)
Set itm = ns. GetItemFromID (arr (i))
If itm. Class = olMail Then
Set m = itm
If UCase (Left (m.subject, 3)) = "API" Then
If (m. DownloadState = olFullItem) Then
Response = parseRequest (m.body)
Call SendResponse (m. Sender. Address, "RE:" + m.subject, Response)
m. MarkAsTask (olMarkComplete)
m. Save
End If
End If
End If
Next
Set ns = Nothing
Set itm = Nothing
Set m = Nothing
End Sub

In letters comes xml in a type olFormatPlain.
With small letters the full order.
But! xml in letters approximately from 300 byte it ceases to be recognized as xml.
Debugging nonplused me. The screenshot see.
At all I do not know as it to explain... If I address to property body object, I receive the truncated text of the letter if to look in a debugger object and to tear its properties in a review tree I see the full text of the letter. And the length of truncated residual depends on the text. In this case 251 character. With other text was 391 character.
Outlook 2013
Who-nt knows as to receive the full text of the letter?
.
------------------------------------------------------------
[img=http://www.sql-ex.ru/certification/csbtn.php?cert_id=A11071618]

2

Re: VBA outlook cuts off the letter text

Try result deduce in txt

Public Function pub_fun_txt (ByVal s As String)
Dim fso, ts As Object
Set fso = CreateObject ("scripting.filesystemobject")
Set ts = fso. CreateTextFile ("....\123.txt", True)
ts. Write s
ts. Close
End Function