A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Extracting info from an Outlook email



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 3rd 07, 03:23 PM posted to microsoft.public.outlook.program_vba
Rob
external usenet poster
 
Posts: 146
Default Extracting info from an Outlook email

I want to automatically extract the body of an incoming email and export the
result to a database or spreadsheet. Similar functions are available through
tools such as Mailbag Assistant for Outlook Express and other email programs.
Is there a way to do this with Microsoft Outlook?
--
Rob
  #2  
Old November 5th 07, 02:53 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Extracting info from an Outlook email

Outlook (unlike Outlook Express) has a rich programming model allowing automation from its own VBA environment, as well as outside applications. You'd use the MailItem.Body property to return the message body.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Rob" wrote in message ...
I want to automatically extract the body of an incoming email and export the
result to a database or spreadsheet. Similar functions are available through
tools such as Mailbag Assistant for Outlook Express and other email programs.
Is there a way to do this with Microsoft Outlook?
--
Rob

  #3  
Old November 5th 07, 05:21 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Extracting info from an Outlook email

Unless you are specifically looking for an existing solution, you could
easily develop this yourself using VBA and the Outlook Object Model. See
this example for handling incoming e-mails:

How to create a custom rule using Visual Basic for Applications (VBA) in
Outlook 2002:
http://support.microsoft.com/default...b;en-us;292063

And this will set you on your way for integrating with a database:

Connecting Outlook to Databases:
http://www.outlookcode.com/article.aspx?ID=25

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Rob" wrote:

I want to automatically extract the body of an incoming email and export the
result to a database or spreadsheet. Similar functions are available through
tools such as Mailbag Assistant for Outlook Express and other email programs.
Is there a way to do this with Microsoft Outlook?
--
Rob

  #4  
Old November 5th 07, 05:48 PM posted to microsoft.public.outlook.program_vba
JP[_2_]
external usenet poster
 
Posts: 18
Default Extracting info from an Outlook email

Hello,

Here's some sample code I use in Excel to play around with email
properties. You could easily adapt this to do what you want.


Dim olApp As Outlook.Application
Dim olNS As Outlook.Namespace
Dim olInbox As Outlook.MAPIFolder
Dim Item As Outlook.MailItem

Set olApp = GetObject(, "outlook.application")
Set olNS = olApp.GetNamespace("MAPI")
Set olInbox = olns.GetDefaultFolder(olFolderInbox)

If olInbox.UnReadItemCount 0 Then
For Each Item In olInbox.Items.Restrict("[Unread] = True")
MsgBox olInbox.UnReadItemCount & "unread emails"
Msgbox "To: " & Item.To
Msgbox "From: " & Item.SenderName
Msgbox "Subject: " & Item.Subject
Msgbox "Body: " & Item.body
Next Item
Else
MsgBox "No new/unread emails", vbInformation
End If

'destroy
Set olInbox = Nothing
Set olNS = Nothing
Set olApp = Nothing


HTH,
JP


On Nov 3, 9:23 am, Rob wrote:
I want to automatically extract the body of an incoming email and export the
result to a database or spreadsheet. Similar functions are available through
tools such as Mailbag Assistant for Outlook Express and other email programs.
Is there a way to do this with Microsoft Outlook?
--
Rob



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting Email from contact Item bbnimda Outlook and VBA 1 October 31st 07 02:21 PM
Where does Outlook 07 store POP3 email account info Tim L. Pearson Outlook - General Queries 3 December 8th 06 01:39 PM
O2003- how to show email account info? (esp. via email hyperlink on a button) StargateFan Outlook - General Queries 2 March 22nd 06 01:35 PM
Extracting email body (only last one) rg Outlook and VBA 1 February 27th 06 07:17 AM
extracting email messages out of Journal Martin Rhodes Outlook - General Queries 0 January 31st 06 12:05 AM


All times are GMT +1. The time now is 09:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.