VBA Outlook MailItem限制FlagRequest =空

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

我想根据某些标准在子文件夹中过滤电子邮件。

标准:FlagRequest条件:“”“空

我已经进行了以下尝试:(很遗憾没有成功)代码:

myRestrict = "[FlagRequest] = ''"
myRestrict = "[FlagRequest] ="""
myRestrict = "[FlagRequest] =' '"
myRestrict = "[FlagRequest] =''"
myRestrict = "[FlagRequest] =" & Chr (34) & Chr (34) & "


 Dim allCount As Integer: allCount = 0
 Dim restCounter As Integer: restCounter = 0
     allCount = oFolder.Items.count
     restCounter = oFolder.Items.Restrict (myRestrict) .count

命中数:0

但是,如果我去:代码:

myRestrict = "[FlagRequest] <> '" & "Follow up" & "'"

过滤器,我得到了搜索的一个,但不幸的是也得到了更多(清晰)。

无法过滤限制,为空?什么是正确的过滤器?

问候woerny

vba filter outlook properties restrict
1个回答
0
投票

当使用DASL查询过滤空字符串时,可以使用Is Null关键字。 Is Null操作对于确定字符串属性是否为空或是否设置了日期属性很有用。有关更多信息,请参见Filtering Items Using Query Keywords

myRestrict = "[FlagRequest] Is Null"
© www.soinside.com 2019 - 2024. All rights reserved.