Instr, InstrRev or Split

LEXCERM

Registered User.
Local time
Today, 15:45
Joined
Apr 12, 2004
Messages
169
Hi there,

I'm trying to find an exact match in a body of an email. Obviously, InStr does not help, but apparently Split does. However, I am not sure how to implement this.

Here is my current code:

Code:
If InStr(1, msg.Body, "AB312") > 0 Then
Msgbox "Found"
Else
Msgbox "Not Found"
End If

Currently, the code finds the word "AB311", but all I want it to find is "AB312".

Thanks in advance.
 
I don't see how Split() would help. That code should work, and should not "find" AB311. It worked correctly in a brief test. What does the msg.Body look like?
 
Hi Paul how are you? I remember you from MDBMakers days and you helped me extensively during my Access initiation process, so many thanks again for your help back then.

Yeah, thanks for your reply. To cut a VERY long story short, you are absolutely right as usual. The code does work as it should. The emails I was working with had anomolies which I wasn't aware of, hence the reason why it was importing data which I thought was incorrect.

Thanks again,
Paul.
 
Happy to help Paul, then and now. I'm doing great, hope you are too! I miss MDBMakers. Glad you got it sorted out.
 

Users who are viewing this thread

Back
Top Bottom