I've developed an Outlook Messagebox region and would like to be able to set one of my fields equal to the contents of the email being written. Any direction on how to accomplish would be appreciated.
Create an outlook addin Application and then do something like this
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
This doesn't reference the email that I currently have open.
ASKER CERTIFIED SOLUTION
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Used Outlook.MailItem to determine the current email information.