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

extract email from message body



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 26th 07, 03:00 AM posted to microsoft.public.outlook.program_vba
Edward
external usenet poster
 
Posts: 56
Default extract email from message body

Can anyone suggest the best way to open each file in an OUtlook subdirectory
and extract an email address from the body of the email? I have mail coming
back as undeliverable, and want to prune those addresses from our lists, but
the address to which the email was sent is not the same as the return
address, which is usually an automated responder from a mail server that
can't find the address in to:

Basically, I'm trying to write code that will say:
go to the undeliverables subdirectory in Outlook;
for each email, check the body of the email for any/all email address(es)
append the email address to a text file;

--
Phantom Researcher
Ads
  #2  
Old April 26th 07, 05:20 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default extract email from message body



You can search the addresses with the Instr function. If there's no specific
position for an address then search for the @ character, then for the
following ' ', and with InstrRev for the leading ' '. Knowing that both
position, you can then extract the string with the Mid function.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Wed, 25 Apr 2007 19:00:02 -0700 schrieb Edward:

Can anyone suggest the best way to open each file in an OUtlook

subdirectory
and extract an email address from the body of the email? I have mail

coming
back as undeliverable, and want to prune those addresses from our lists,

but
the address to which the email was sent is not the same as the return
address, which is usually an automated responder from a mail server that
can't find the address in to:

Basically, I'm trying to write code that will say:
go to the undeliverables subdirectory in Outlook;
for each email, check the body of the email for any/all email address(es)
append the email address to a text file;

  #3  
Old April 26th 07, 02:28 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default extract email from message body

Or use regular expressions.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michael Bauer [MVP - Outlook]" wrote in message ...


You can search the addresses with the Instr function. If there's no specific
position for an address then search for the @ character, then for the
following ' ', and with InstrRev for the leading ' '. Knowing that both
position, you can then extract the string with the Mid function.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Wed, 25 Apr 2007 19:00:02 -0700 schrieb Edward:

Can anyone suggest the best way to open each file in an OUtlook

subdirectory
and extract an email address from the body of the email? I have mail

coming
back as undeliverable, and want to prune those addresses from our lists,

but
the address to which the email was sent is not the same as the return
address, which is usually an automated responder from a mail server that
can't find the address in to:

Basically, I'm trying to write code that will say:
go to the undeliverables subdirectory in Outlook;
for each email, check the body of the email for any/all email address(es)
append the email address to a text file;

  #4  
Old April 26th 07, 04:29 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default extract email from message body



Do you like to explain them here?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Thu, 26 Apr 2007 09:28:16 -0400 schrieb Sue Mosher [MVP-Outlook]:

Or use regular expressions.

  #5  
Old April 26th 07, 05:52 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default extract email from message body

Actually you don't have to parse anything: what Outlook shows as an NDR body
is dynamically constructed from various recipient properties - look at an
NDR with OutlookSpy (click IMessage button and go to the GetRecipientTable
tab).
You can access these properties using Extended MAPI or Redemption (but not
CDO 1.21 since itt does not provide access to the message recipient table
properties)

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Edward" wrote in message
...
Can anyone suggest the best way to open each file in an OUtlook
subdirectory
and extract an email address from the body of the email? I have mail
coming
back as undeliverable, and want to prune those addresses from our lists,
but
the address to which the email was sent is not the same as the return
address, which is usually an automated responder from a mail server that
can't find the address in to:

Basically, I'm trying to write code that will say:
go to the undeliverables subdirectory in Outlook;
for each email, check the body of the email for any/all email address(es)
append the email address to a text file;

--
Phantom Researcher



  #6  
Old April 26th 07, 09:28 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default extract email from message body

No! g I think I've tried to explain regular expressions just once and failed miserably. But MSDN has good material including a tutorial, IIRC.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michael Bauer [MVP - Outlook]" wrote in message ...


Do you like to explain them here?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Thu, 26 Apr 2007 09:28:16 -0400 schrieb Sue Mosher [MVP-Outlook]:

Or use regular expressions.

  #7  
Old April 26th 07, 09:28 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default extract email from message body

That's if it's a true NDR from an Exchange server. If it's not, then the message body text has to be parsed.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Dmitry Streblechenko" wrote in message ...
Actually you don't have to parse anything: what Outlook shows as an NDR body
is dynamically constructed from various recipient properties - look at an
NDR with OutlookSpy (click IMessage button and go to the GetRecipientTable
tab).
You can access these properties using Extended MAPI or Redemption (but not
CDO 1.21 since itt does not provide access to the message recipient table
properties)



"Edward" wrote in message
...
Can anyone suggest the best way to open each file in an OUtlook
subdirectory
and extract an email address from the body of the email? I have mail
coming
back as undeliverable, and want to prune those addresses from our lists,
but
the address to which the email was sent is not the same as the return
address, which is usually an automated responder from a mail server that
can't find the address in to:

Basically, I'm trying to write code that will say:
go to the undeliverables subdirectory in Outlook;
for each email, check the body of the email for any/all email address(es)
append the email address to a text file;

--
Phantom Researcher



  #8  
Old April 29th 07, 04:40 PM posted to microsoft.public.outlook.program_vba
ed
external usenet poster
 
Posts: 114
Default extract email from message body

I can't seem to address the body of the email. I have a routine that cycles
through the index of the Inbox, but am unsure how to actually address the
body of the email. Is it an Item, a message, a body, a PR_body, etc. Can't
seem to address it.

Also, I have a search string, " *@* ", which should work if I can find the
right way to run the body through it. However, the like operator doesn't work
in the AdvancedSearch function.

"Michael Bauer [MVP - Outlook]" wrote:



You can search the addresses with the Instr function. If there's no specific
position for an address then search for the @ character, then for the
following ' ', and with InstrRev for the leading ' '. Knowing that both
position, you can then extract the string with the Mid function.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Wed, 25 Apr 2007 19:00:02 -0700 schrieb Edward:

Can anyone suggest the best way to open each file in an OUtlook

subdirectory
and extract an email address from the body of the email? I have mail

coming
back as undeliverable, and want to prune those addresses from our lists,

but
the address to which the email was sent is not the same as the return
address, which is usually an automated responder from a mail server that
can't find the address in to:

Basically, I'm trying to write code that will say:
go to the undeliverables subdirectory in Outlook;
for each email, check the body of the email for any/all email address(es)
append the email address to a text file;


  #9  
Old April 30th 07, 06:28 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default extract email from message body



'Scope' is the folder's name, Inbox for instance. This filter works for
plain text:
"urn:schemas:httpmail:textdescription LIKE '%@%'"

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Sun, 29 Apr 2007 08:40:01 -0700 schrieb Ed:

I can't seem to address the body of the email. I have a routine that

cycles
through the index of the Inbox, but am unsure how to actually address the
body of the email. Is it an Item, a message, a body, a PR_body, etc.

Can't
seem to address it.

Also, I have a search string, " *@* ", which should work if I can find

the
right way to run the body through it. However, the like operator doesn't

work
in the AdvancedSearch function.

"Michael Bauer [MVP - Outlook]" wrote:



You can search the addresses with the Instr function. If there's no

specific
position for an address then search for the @ character, then for the
following ' ', and with InstrRev for the leading ' '. Knowing that both
position, you can then extract the string with the Mid function.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:

http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Wed, 25 Apr 2007 19:00:02 -0700 schrieb Edward:

Can anyone suggest the best way to open each file in an OUtlook

subdirectory
and extract an email address from the body of the email? I have mail

coming
back as undeliverable, and want to prune those addresses from our lists,

but
the address to which the email was sent is not the same as the return
address, which is usually an automated responder from a mail server that
can't find the address in to:

Basically, I'm trying to write code that will say:
go to the undeliverables subdirectory in Outlook;
for each email, check the body of the email for any/all email

address(es)
append the email address to a text file;


  #10  
Old April 30th 07, 06:30 PM posted to microsoft.public.outlook.program_vba
ed
external usenet poster
 
Posts: 114
Default extract email from message body

Thank you! That's what I was trying to do.

"Edward" wrote:

Can anyone suggest the best way to open each file in an OUtlook subdirectory
and extract an email address from the body of the email? I have mail coming
back as undeliverable, and want to prune those addresses from our lists, but
the address to which the email was sent is not the same as the return
address, which is usually an automated responder from a mail server that
can't find the address in to:

Basically, I'm trying to write code that will say:
go to the undeliverables subdirectory in Outlook;
for each email, check the body of the email for any/all email address(es)
append the email address to a text file;

--
Phantom Researcher

 




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
How do I modify the message body displayed in the email window? Steffen Heinzl Add-ins for Outlook 4 November 10th 06 09:49 AM
Email font size in body changes randomly after the message is sent [email protected] Outlook - General Queries 0 May 31st 06 10:52 PM
Help: Send To Email Message in Body TJ Outlook Express 3 May 4th 06 01:23 PM
Attachment does not show on header but in message body when create new email Johnny Chow Outlook - General Queries 2 January 30th 06 10:47 PM
How to filter email with blank subject, to, and message body ken4az Outlook - Installation 0 January 20th 06 05:27 PM


All times are GMT +1. The time now is 08:01 AM.


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