Your technology certification is waiting. Enroll in Cloud Class ®
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
This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.