View Single Post
  #3  
Old December 4th 07, 10:07 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default reading message body line by line in VBA

Assuming the body has line breaks, you could read it into an array using the Split() function, then read element of the array:

arr = Split(myItem.Body, vbCrLf)
MsgBox arr(0)
etc.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Mark VII" wrote in message ...
Greetings --

I need to read the body of an email message one line at a time, much as you
would do with Line Input when reading a text file. Have code working that
opens an email item, and I can read the MailItem.Body into a string variable.
In my situation (long story), it would be easier if I could read the body as
a series of individual lines of text.

Any suggestions? TIA...

Mark

Ads