附件下载地址:http://aisoyi.5d6d.com/viewthread.php?tid=334&extra=
根据Outlook收件箱的邮件提取发件人邮箱地址到excel后再导入到Outlook联系人
步骤如下: 1,新建工作簿book1,第一张表取名“邮件地址提取”,并保存 2,ALT+f11,进入vba,插入模块1,复制粘贴如下代码:
Sub GetSender()
'按照邮件接收日期由最近到最早的顺序提取发件人邮箱地址到Excel
Dim myOlApp As Outlook.Application Dim mpfInbox As Outlook.MAPIFolder Dim obj As Outlook.MailItem Dim myexApp As Excel.Application Dim i As Integer
Set myOlApp = CreateObject("Outlook.Application") Set mpfInbox = myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
Workbooks("Book1.xls").Worksheets("邮件地址提取").Select
For i = mpfInbox.Items.Count To 1 Step -1 If mpfInbox.Items(i).Class = olMail Then Set obj = mpfInbox.Items.Item(i) Cells(i, 1) = obj.SenderEmailAddress Cells(i, 2) = obj.SenderName End If Next i
End Sub
3,由于提取到的邮箱地址也许有重复的(同一个发件人发多封邮件给你),所以要利用03excel高级筛选或07excel删除重复值的功能,剔除重复值
4,复制剔除重复值后的邮箱地址和发件人姓名等到另一张excel表格,并对该数据区域命名为mymail(任意名字均可),保存
5,打开outlook,进入联系人,利用导入和导出的功能-从另一程序和文件导入-excel2003-2007,建立好映射关系后导入即可 book1.rar :[upload=rar]down10_0927.asp?ID=139843[/upload]
|