Avatar of Antonio King
Antonio King

asked on 

Outlook macro to extract address from body of email into CSV

Wondering if anyone can help me with an Outlook macro?

I need a macro that will run against the selected folder.
The macro should review all items with the subject "[Postmaster] Email Delivery Failure]"
It should then extract the email address found within the body of the email and save it to a csv file

Each item found with an email address in the body should be appended to the csv file.

Many thanks!
VB ScriptOutlookVBA

Avatar of undefined
Last Comment
Bill Prew
Avatar of Bill Prew
Bill Prew

How can the email address be located in the body of the email?  Please provide sample(s).

Is this a typo for the subject, or does it look exactly like that?

"[Postmaster] Email Delivery Failure]"

Avatar of Antonio King
Antonio King


Hi bill
That is a typo. Well spotted
The subject is "[Postmaster] Email Delivery Failure"

A typical email body would look like this...
This is a delivery failure notification message indicating that an email you addressed to email address :
-- email@domain.com

could not be delivered. The problem appears to be :
-- Recipient email server rejected the message

Additional information follows :
-- delivery error: dd This user doesn't have a yahoo.com account (email@domain.com) [0] - mail.server.com

This condition occurred after 1 attempt(s) to deliver over a period of 0 hour(s).

If you sent the email to multiple recipients, you will receive one of these messages for each one which failed delivery,  otherwise they have been sent.
Avatar of Bill Prew
Bill Prew

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial

Microsoft Outlook is a personal information manager from Microsoft, available as a part of the Microsoft Office suite. Although often used mainly as an email application, it also includes a calendar, task manager, contact manager, note-taker, journal, and web browser.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo