Searching saved .msg email, then conditional if term is found

southen

Registered User.
Local time
Today, 10:45
Joined
Jan 11, 2013
Messages
22
I have one other element that I'm trying to implement in my Access DB - that is, to search a saved email (.msg) subject & body for certain text, and then follow this with conditions - if A, then update me.Title with 1, if, B, update me.Title with 2, if C, update me.Title with 3, etc. etc.

I'm having difficulty searching the email subject & body, and I was hoping I can get some guidance on this.

Thanks!!
 
Last edited:
I hate to answer two of my questions, but I wanted to share my solution in case someone else finds it helpful. Now the last step, finding out how to insert text from a field into the .msg...

Code:
 'This command below will search the email body for the following words and if found, insert them into the field "Description"
            If InStr(msg.Subject, "Word 1") > 0 Or InStr(msg.Body, "Word 1") > 0 Then
            Me.Description = "Word 1"
            ElseIf InStr(msg.Subject, "Word 2") > 0 Or InStr(msg.Body, "Word 2") > 0 Then
            Me.Description = "Word 2"
            End
        End If
 

Users who are viewing this thread

Back
Top Bottom