WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE and Outlook
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

OLE and OUTLOOK read mail.

Keywords:    OLE OUTLOOK inbox check mail MAPI

Question:

I want a script to read all the body's of the messages in my Outlook inbox.

Answer:

Here is some code the can look at the inbox in Outlook to see if there is any messages,and displays the message body in a dialog.......

olFolderInbox=6 ;constant DO NOT CHANGE

MSapp = ObjectOpen ("Outlook.Application")

objNameSpace = MSapp.GetNamespace("MAPI")

objFolder = objNameSpace.GetDefaultFolder(olFolderInbox);  'Access the Inbox

objFolder.Display

objcount=objFolder.Items

mycount=objcount.Count;checks number of messages in inbox!

For xx = 1 to mycount 

  objitem=objFolder.Items(xx)

  myText = objitem.Body

  message("Message Body #%xx%",mytext)

Next

ObjectClose(MSapp)

exit



Article ID:   W14480
Filename:   OLE and OUTLOOK read mail.txt
File Created: 2000:04:21:10:44:38
Last Updated: 2000:04:21:10:44:38