Experts Exchange connects you with the people and services you need so you can get back to work.
Private Sub Application_NewMail() Handles Application.NewMail
Dim tempApp As Outlook.Application
Dim tempInbox As Outlook.MAPIFolder
Dim InboxItems As Outlook.Items
tempApp = CreateObject("Outlook.Application")
tempInbox = tempApp.GetNamespace("Mapi").GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
InboxItems = tempInbox.Items
Dim newMail As Outlook.MailItem
Dim inBox As Outlook.MAPIFolder = Me.Application.ActiveExplorer().Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
Dim DestinationFolder As Outlook.MAPIFolder = inBox.Folders("Processed")
For Each newMail In InboxItems
Dim Des As String = newMail.Body
'On Des variable you will have the body of the message for each new email that comes to the inbox
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.