Set myOlApp = CreateObject("Outlook.Application"
Set myNameSpace = myOlApp.GetNamespace("MAPI"
Set MyFolder = myNameSpace.Folders("Personal Folders"("Inbox"
For Each myMailItem in MyFolder.Items
If myMailItem.Unread Then
mySubject = mymailItem.Subject
myBody = myMailItem.Body
'do whatever you like with them
' .......
myMailItem.Unread=False
End If
Next
Set myFolder = Nothing
Set myNameSpace = Nothing
Set myOlApp = Nothing
Run the code from the Timer event of a form and it will check the mapi folder regularly...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.