Actions when email received

I did something similar and it works fairly well. The codes saves the contents of the email into a text file.

 Dim objItem As Object
 Dim myFolder As Folder
 If Not TypeName(myItem) = "Nothing" Then
    If LCase(myMail.Subject) = "SubjectKeyword" Then
        strname = myMail.Subject
        strdate = Format(myMail.ReceivedTime, "yymmddhhmmss")
        myMail.SaveAs "C:\EmailFiles\" & strdate & ".txt", olTXT
    End If
 End If

End Sub

I have then a process that picks up new files in the folder, reads the contents and acts upon the information received

There is a problem thought that the text is wrapped, so I had to find a way to merge the text

3 Likes