How to read each line of an e-mail for processing in Outlook VBA
Posted on 2006-04-29
I have the following code to process an incoming e-mail in Outlook:
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim olMail As Outlook.MailItem
strID = oEmail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set olMail = olNS.GetItemFromID(strID)
olMail.BodyFormat = olFormatPlain ' If it's HTML, convert it to plain text
I can get the body of the e-mail with olMail.Body.
Can someone please provide the code that will read the body of the e-mail one line at a time and put it into a string sLine?