创建搜索文件夹并访问ReplyRecipients

问题描述 投票:0回答:1

我尝试在Outlook-2010中创建一个搜索文件夹,代表与特定电子邮件有关的所有MailItem。即将电子邮件地址设置为SenderEmailAddress或Sender的MailItems或收件人之一或ReplyRecipients之一。

据我所知,我无法使用Application.AdavancedSearch方法和DASL过滤器执行此操作,因为无法访问收件人或ReplyReciriens。因此,我尝试使用Redemption Searches对象设置限制,下面是代码:

Set Store = RDSessoin.Stores.DefaultStore
Set Searches = Store.Searches
Set Folder = Store.IPMRootFolder

Addr = "[email protected]" 'the email being searched

SQL = "(SenderEmailAddress LIKE '%" & Addr & "%') OR " & _
        "(Recipients LIKE '%" & Addr & "%')"

Set NewSearch = Searches.AddCustom(Addr, strSQL, Folder)

可以,但是不包括ReplyRecipients和发件人条件。当我尝试将其添加到限制中时

SQL = "(SenderEmailAddress LIKE '%" & Addr & "%') OR " & _
        "(Recipients LIKE '%" & Addr & "%') OR " & _
        "(ReplyRecipients LIKE '%" & Addr & "%') OR " & _
        "(Sender LIKE '%" & Addr & "%')"

发生错误“未知的属性名称”。

所以有一个问题-正确的限制语法是什么,还有其他创建此搜索文件夹的方法。

预先感谢]

vba email outlook-redemption
1个回答
0
投票

您不能使用ReplyRecipients,因为它是一个包含条目ID的二进制属性(用处不大),但是您可以改用ReplyRecipientNames

© www.soinside.com 2019 - 2024. All rights reserved.