Posted on 2011-03-15
I ran into a problem where after retrieving the mailitem body text, the result appears what i see isn't what i get. In my case:
Dim objOutlook As Outlook.Application
Dim oMail As Outlook.MailItem
Set oMail = Application.ActiveInspector.CurrentItem
Dim strBody As String
strBody = oMail.Body
after these codes I found strBody string is a whole line of string which looks fine to me. then i started my processing:
if strBody = "Daily" then
i = 1
For illustrating purpose, my strBody in my Email returns me "Daily" as i debug.print mailitem.body in immediate window. but when i run the if statements, it never went through 'Then'.
It turns out to me that strBody isn't just "Daily" as what i saw in immediate window.
I also did a check on mailitem.bodyformat, it is plaintext. Does anybody have a clue how do i solve this issue?