String in msg body

  • Thread starter Thread starter gamename
  • Start date Start date
G

gamename

Hi,

Is there a quick way to determine if a string exists somewhere an
email's body without having to read it line-by-line?

TIA,
-T
 
You have to parse Item.Body to see if the string is in there no matter what
you do.
 
Ken said:
You have to parse Item.Body to see if the string is in there no matter what
you do.

So, you're saying that I have to read Item.Body line-by-line, and look
in each string for a substring . There is no separate method to simply
verify that a certain string does or does not exist somewhere inside of
Item.Body. Correct?
 
Is there a quick way to determine if a string exists somewhere an
email's body without having to read it line-by-line?

I don't know what you mean by "read it line-by-line"; AFAIK there is no
such method to access the body of a message.

This is the normal method to determine the existence and position of a
string in a message's body:
lngP1 = InStr(ActiveInspector.CurrentItem.Body,"fubar")

For details, see Help on "Function InStr".
 
As Michael said you just use Item.Body to read the entire body as one long
string. Then use InStr or some other string function to look for what you
want.
 
Thanks guys, that answers my question.

When I said 'line-by-line', I meant a collection of strings delimited
by control characters (like newline or null). Some environments will
see entities similar to Body as a set of individual lines, and others
treat it like a single string a chars.

Evidently then, a mail message body in outlook is treated vb as one
long string rather than lots of shorter ones.

I'm rather new to VB, so I'm still getting the hang of it.

Thanks again,
-T
 
Back
Top