我正在使用Visual Basic 2017,并且试图创建一个程序来删除刚刚基于特定主题发送的Outlook邮件。
下面是代码:
Dim mySentSpace As myOutlook.NameSpace
Dim mySentFolder As myOutlook.Folder
Dim myItem As myOutlook.MailItem
mySentSpace = myAppOutlook.GetNamespace("MAPI")
mySentFolder = mySentSpace.GetDefaultFolder(myOutlook.OlDefaultFolders.olFolderSentMail)
For Each myItem In mySentFolder.Items
If myMail.Subject = "PASSWORD REQUEST (DELETED)" Then
myMail.Delete()
End If
Next