Excel VBA从Outlook收件箱中的指定文件夹复制电子邮件正文中的数字并粘贴到Excel。 [英] Excel VBA to copy numbers in e-mail body from specified folder in outlook inbox and paste to excel.

查看:532
本文介绍了Excel VBA从Outlook收件箱中的指定文件夹复制电子邮件正文中的数字并粘贴到Excel。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人可以帮我写一个vba代码,我可以在Outlook收件箱中的指定文件夹中复制电子邮件正文中的数字并粘贴到excel"A列",以及粘贴在"B列"中的电子邮件(所有电子邮件都在
文件夹中)。假设我在outlook中的文件夹名称是"TEMP"。附件是示例电子邮件,突出显示的项目是将要复制的项目。





vlady mhore

解决方案

您好,


从Excel自动化Outlook ,请访问从Visual Basic应用程序自动化Outlook   &安培;
从其他Office应用程序自动化Outlook ,然后您可以使用  MailItem.Subject Property(Outlook)   MailItem.Body
Property(Outlook)
 获取您想要的主题和正文字符串。 


要循环浏览文件夹中的邮件项目,您可以参考


https://stackoverflow.com/questions/24321752/outlook-vba-how- to-loop-through-inbox-and-list-from-email-email-address-if-subje


https://stackoverflow.com/questions/2272361/can-i-it erate-through-all-outlook-email-in-a-folder-including-sub-folders


要获取正文字符串中的数字,可以参考以下案例:


https://stackoverflow.com/questions/15369485/how-to-extract-groups-of-numbers-from-a-string-in-vba


问候,


Celeste


Hi is there anyone who could help me write a vba code wherein I can copy numbers in e-mail body from specified folder in outlook inbox and paste to excel "Column A", and also the subject of the e-mail pasted in "Column B"(All emails in the folder). Lets say my folder name in outlook is "TEMP". Attached is the sample e-mail and the highlighted items are the ones that will be copied.


vlady mhore

解决方案

Hello,

To automate Outlook from Excel, please visit Automating Outlook from a Visual Basic Application  & Automating Outlook from Other Office Applications, then you could use MailItem.Subject Property (Outlook) and MailItem.Body Property (Outlook) to get the subject and body string you want. 

To loop through the mailitems in the folder, you could refer to

https://stackoverflow.com/questions/24321752/outlook-vba-how-to-loop-through-inbox-and-list-from-email-email-address-if-subje

https://stackoverflow.com/questions/2272361/can-i-iterate-through-all-outlook-emails-in-a-folder-including-sub-folders

To get the number in your body string, you could refer to the following case:

https://stackoverflow.com/questions/15369485/how-to-extract-groups-of-numbers-from-a-string-in-vba

Regards,

Celeste


这篇关于Excel VBA从Outlook收件箱中的指定文件夹复制电子邮件正文中的数字并粘贴到Excel。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆