Outlook email parse

Hi,
I am looking to parse the body of a folder of email possibly via outlook or outlook express (but from what I understand outlook must be used in this case).  The email should only be parsed if the subject has a certain title in it.  While parsing the program will save any data that it needs to save in some variables which will later be printed out in a .txt file.  My question is should I try to interact directly with outlook or should I just I bypass outlook altogether and instead create my own mapi session to interact with the program.  If anyone has any sample code on how to do either of these two things or knows of a good tutorial that could help me out in this area (i have already read the MSDN concerning MAPI and am still fuzzy on this topic) I would appreciate it.
thanks
kserraAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
vinnyd79Connect With a Mentor Commented:
you can use the outlook object Model.Try this example,add a reference to Microsoft Outlook Object Library:

Dim objOutlook As New Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objFolder As MAPIFolder
Dim objMail As MailItem


Private Sub Command1_Click()
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNameSpace.GetDefaultFolder(olFolderInbox)
For i = 1 To objFolder.Items.Count
Set objMail = objFolder.Items(i)
     
     ' add inbox subjects to listbox
    List1.AddItem objMail.Subject
   
    ' check message subjects for 'Some Title Here'
    If InStr(1, objMail.Subject, "Some Title Here") > 0 Then

        ' subject found  - check body for the word cheese
        If InStr(1, objMail.Body, "cheese") > 0 Then
        ' found
        ' get variables from objMail.Body
       
        End If
    End If
Next i
End Sub
0
 
CleanupPingCommented:
Hi kserra,
This old question (QID 20569440) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
GrahamSkanRetiredCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept vinnyd79's comment as answer
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GrahamSkan
EE Cleanup Volunteer
0
All Courses

From novice to tech pro — start learning today.