|
在Outlook 搜寻邮件主旨中有特定文字的邮件是搜寻不到的
如:
搜寻已下邮件可以找到
Set colFiltered = colItems.Restrict("[Subject] = 'MailCloud 广告信报表 (SPAM Report)'")
搜寻已下邮件就不能找到
Set colFiltered = colItems.Restrict("[Subject] = 'FW: MailCloud 广告信报表(SPAM Report)'")
Set colFiltered = colItems.Restrict("[Subject] = 'FW:MailCloud 广告信报表(SPAM Report)'")
请问是什么原因?
代码如下- Private Sub tset()
- Const olFolderInbox = 6
- Set objOutlook = CreateObject("Outlook.Application")
- Set objNamespace = objOutlook.GetNamespace("MAPI")
- Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox)
- Set colItems = objFolder.Items
- Set colFiltered = colItems.Restrict("[Subject] = 'FW: MailCloud 广告信报表(SPAM Report)'")
- 'Set colFiltered = colItems.Restrict("[Subject] = 'MailCloud 广告信报表(SPAM Report)'")
- For Each objMessage In colFiltered
-
- MsgBox "Subject:" & objMessage.Subject & objMessage.SenderEmailAddress & objMessage.ReceivedTime
-
- Next
- End Sub
复制代码
|
|