使用VBA从Outlook电子邮件正文中提取电子邮件地址?
问题描述:
我在我公司的交换服务器上使用outlook 2000和登录ID。使用VBA从Outlook电子邮件正文中提取电子邮件地址?
我有一个名为“undelivered_email”的文件夹,位于个人文件夹下。我制定了一条规则,将所有电子邮件的副本移到标题类似“未传送的电子邮件”的位置。
现在,我怎么能遍历这个“undelivered_email”文件夹中的所有电子邮件,并访问每个电子邮件的正文,然后得到任何电子邮件地址内的内容主体?
例如,这是一个未交付的电子邮件通知的内容的副本:
####################################################################
# THIS IS A WARNING ONLY. YOU DO NOT NEED TO RESEND YOUR MESSAGE. #
####################################################################
Your message could not be delivered for 1 days, 20 hours, 0 minutes.
It will be retried until it is 3 days, 0 hours, 0 minutes old.
For further assistance, please send mail to <postmaster>
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
<[email protected]>: this domain could be reached at this time
嗯,我并不真的需要使用VBA,任何方法都行。应该是最简单的一个。 我有很多这样undelivered电子邮件通知处理,我需要提取里面的电子邮件。如果我们可以将电子邮件列表导出到一个文件,这将是一件好事。
答
我用Google搜索 “观VBA退回的电子邮件”,并得到了一些有希望的命中:
- MS Access, Outlook: recording bounced email addresses
- Parse email body for email addresses and write them to Excel
如果可以的话,我自己的网站有代码如下: