0

我在联系人中的自定义日期使用过滤器时遇到问题。

RDOItems Contacts = null;
string strSearch = string.Empty;

strSearch = AddQuotes("http://schemas.microsoft.com/mapi/string/{01234567-8901-2345-C678-901234567801}/CustomFieldString");

strSearch += " <> '' ";

strSearch += " AND ";
strSearch +=  AddQuotes("http://schemas.microsoft.com/mapi/string/{01234567-8901-2345-C678-901234567802}/CustomFieldDate");
strSearch += " < ";
strSearch += "'2010-04-28 18:00'";                                 

Contacts = (RDOItems)synContacts.Items.Restrict(strSearch)

当我只使用过滤器的第一部分(CustomFieldString)时,我得到了正确的联系人,但是当我使用日期时间字段展开过滤器时,没有返回联系人。

谢谢,

斯皮捷

4

1 回答 1

0

如果命名的 MAPI 属性有一个字符串作为 anid(与整数相反),则无法在 DASL 名称中指定属性类型,因此 Redemption 假定为字符串。

如果属性被添加到文件夹字段中,属性定义将存储在该文件夹中的隐藏消息中,您可以只使用属性名称 (CustomFieldDate) 否则您可以调用 GetIdsFromNames 来找出属性标签,“或" 使用适当的类型 (PT_SYSTIME),然后构造看起来像常规(未命名)MAPI 属性的 DASL 名称:

例如http://schemas.microsoft.com/mapi/proptag/ 0x80650040

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook、CDO
和 MAPI 开发工具

于 2010-04-29T19:07:11.977 回答