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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I read a message from Outlook?

Status
Not open for further replies.

dellyjm

Programmer
Apr 13, 2000
168
JM
Hi guys i'm building an application that should read the body of a Email message from Outlook. I'm not sure how to do this, any pointers?

Thanks.

Delton.
 
Hi,
You have a MAPI object in VB. In fact there are two MAPI objects. The fist is used to open a session and the other one is to look a eMails. There are lots of examples at Go to the VB section and do a search on MAPI OUTLOOK. It's not hard, but it's something that you can't remember all the time and have to look it up.

hth, John
 
Found this code in the help
Private Sub Command2_Click()

Set myOlApp = GetObject("", "Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNamespace.GetDefaultFolder(olFolderInbox)
myFolder.Display
Set myItem = myFolder.Items.Find("[From] = delslyajm@yahoo.com")
myItem.Display
MsgBox myItem.Body

End Sub

Delton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top