PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

extract email from message body

 
 
=?Utf-8?B?RWR3YXJk?=
Guest
Posts: n/a
 
      26th Apr 2007
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
 
Reply With Quote
 
 
 
 
Michael Bauer [MVP - Outlook]
Guest
Posts: n/a
 
      26th Apr 2007


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;

 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      26th Apr 2007
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]" <(E-Mail Removed)> wrote in message news:4s7a71xlicmw$.z8snj21okmjk$.(E-Mail Removed)...
>
>
> 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;

 
Reply With Quote
 
Michael Bauer [MVP - Outlook]
Guest
Posts: n/a
 
      26th Apr 2007


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.

 
Reply With Quote
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      26th Apr 2007
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" <(E-Mail Removed)> wrote in message
news:04D64638-5C3A-46D3-B90F-(E-Mail Removed)...
> 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



 
Reply With Quote
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      26th Apr 2007
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]" <(E-Mail Removed)> wrote in message news:tbqs3amsstqe$.(E-Mail Removed)...
>
>
> 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.

 
Reply With Quote
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      26th Apr 2007
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" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:04D64638-5C3A-46D3-B90F-(E-Mail Removed)...
>> 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

>
>

 
Reply With Quote
 
=?Utf-8?B?RWQ=?=
Guest
Posts: n/a
 
      29th Apr 2007
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;

>

 
Reply With Quote
 
Michael Bauer [MVP - Outlook]
Guest
Posts: n/a
 
      30th Apr 2007


'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;

>>

 
Reply With Quote
 
=?Utf-8?B?RWQ=?=
Guest
Posts: n/a
 
      30th Apr 2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
extract email address from body of message and put in csv Amanda Microsoft Outlook Program Addins 2 29th Jul 2012 11:01 PM
Extract body from MIME message centur Microsoft C# .NET 0 5th May 2006 04:27 PM
Extract text from the message body and show in msgbox =?Utf-8?B?TU1vdXNlOTk=?= Microsoft Outlook VBA Programming 1 21st Jul 2005 02:39 PM
How can I distinguish the email body is plain text or html body? epjames Microsoft Outlook VBA Programming 10 2nd Sep 2004 01:03 PM
attachments are in the body of email, not on line above the body seeker@chi.net.au Microsoft Outlook Discussion 2 5th Jul 2004 07:56 PM


Features
 

Advertising
 

Newsgroups
 


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