Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access and out look

Status
Not open for further replies.

amal1973

Technical User
Jul 31, 2001
131
US
I receive 100 emails a day, same subject but with different information in the body. I want to be able to create a Macro or VBA code that will open every email with the specified subject and populate an access table with the data. This is how it looks.. Appreciate any help

==============================================================
BIONIC DIRECTOR LEAD
First Name........Nancy J
Last Name.........Gutzmer
Spouse First......
Spouse Last.......
Telephone No......800 740-2554
Email Address.....ngur@richmond.edu
Lead Source.......Direct Mail
Ref...............
Ad Code...........
Director...........Max Benson


==============================================================
 
I have used automation with Access 97 to open an Outlook folder and process each message. This should get you started - it is just the important steps. Add the reference for MS Outlook in the Visual Basic Editor so you'll be able to see all of the help available for those objects.

***************************************************
Set myOlApp = CreateObject ("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)

i = 0
While i < myFolder.Items.Count

Set myItem = myFolder.Items(i)
If myItem.Subject = strSubjectSearch Then
...
End If
i = i + 1

Wend
*********************************************************

If you delete messages as part of the loop, I believe the message index will change for the remaining messages. I think you would just skip the increment of i but I would have to test that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top