Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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