使用 VBA 从 Outlook 电子邮件正文中提取电子邮件地址?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5986669/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 13:13:54  来源:igfitidea点击:

Extract email addresses from Outlook email body using VBA?

vbaoutlook

提问by lamwaiman1988

I am using outlook 2000 with a login id in a exchange server of my company.

我在我公司的交换服务器中使用带有登录 ID 的 Outlook 2000。

I have a folder named "undelivered_email" which in under personal folder. I set a rule to move a copy of all the email with title similar to "undelivered email".

我在个人文件夹下有一个名为“undelivered_email”的文件夹。我设置了一个规则来移动标题类似于“未送达的电子邮件”的所有电子邮件的副本。

Now, how can I loop through all the email in this "undelivered_email" folder, and access the body of each email, then get any email address insidethe content body?

现在,如何通过所有的电子邮件,我在圈这个“undelivered_email”文件夹中,并获得了每封电子邮件的身体,然后得到任何电子邮件地址里面内容主体

For example, this is a copy of the content of a undelivered email notice:

例如,这是未送达电子邮件通知内容的副本:

####################################################################
# 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


Well, I don't really need to use vba, any method will do. Should be the easiest one. I have a lot of such undelivered email notice to handle, I need to extract the email inside. And it would be good if we can export the email list to a file.

好吧,我真的不需要使用 vba,任何方法都可以。应该是最简单的。我有很多这样的未送达邮件通知要处理,我需要提取里面的邮件。如果我们可以将电子邮件列表导出到文件中,那就太好了。

回答by JimmyPena

I Googled "outlook vba bounced email" and got some promising hits:

我在 Google 上搜索了“outlook vba 退回的电子邮件”并获得了一些有希望的点击: