View Single Post
  #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



Ads