- wps工作表格制作教程:wps怎么制作漂亮的个人简历? wps个人简历的设计方法
- wps文字排版新手教程:wps表格怎样设置密码
- wps教程零基础教程:电脑版wps文档如何调节页码大小
- word文档流程图制作教程:电脑版wps文档如何自定义字号
OUTLOOK自动删除重复邮件脚本
Sub DeleteMail()
'outLook2007版本验证!使用前请调低宏安全性
Dim olApp As New Outlook.Application
Dim fld_Inbox As Outlook.Folder
Dim objItems As Outlook.Items
Dim myItem As Object
Dim dupItem As Object
Dim i As Long
Dim ThisSenderEmailAddress, NextSenderEmailAddress As String
Dim ThisSize, NextSize As Long
Dim ThisSentOn, NextSentOn As Date
Dim ThisBody, NextBody As String
Set fld_Inbox = olApp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
Set objItems = fld_Inbox.Items
'按发信时间过滤邮件列表,WORD上下页,
'Set objItems = objItems.Restrict("[SentOn] > '8/1/2014'")
objItems.Sort "[SentOn]", True
Set myItem = objItems.GetFirst
i = 0
Do While TypeName(myItem) <> "Nothing"
If TypeName(myItem) = "MailItem" Then
ThisSenderEmailAddress = myItem.SenderEmailAddress '发件人邮箱
ThisSize = myItem.Size '邮件大小
ThisSentOn = myItem.SentOn '发信时间,如"2015/8/28 9:57:02"
ThisBody = myItem.Body '邮件文本内容
Set dupItem = objItems.GetNext
If TypeName(dupItem) = "MailItem" Then
NextSenderEmailAddress = dupItem.SenderEmailAddress
NextSize = dupItem.Size
NextSentOn = dupItem.SentOn
NextBody = dupItem.Body
'删除发件人、发信时间和邮件内容完全相同的邮件
If ThisSenderEmailAddress = NextSenderEmailAddress And ThisSentOn = NextSentOn And ThisBody = NextBody Then
dupItem.Delete
i = i + 1
Else
Set myItem = dupItem
End If
Else
Set myItem = dupItem
End If
Else
Set myItem = objItems.GetNext
End If
Loop
End Sub
本地下载
,wordpress菜鸟教程,word办公软件使用教程上一篇:word制作表格教程基础入门:OutLook 编程 下一篇:word文档排版教程:Outlook 自动删除重复邮件VBA脚本
郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。