PropertyTest 对象

优质
小牛编辑
130浏览
2023-12-01

代表一个单一的文件搜索条件。搜索条件列在“查找”对话框中(单击“文件”菜单中的“打开”命令,单击“查找”按钮)。PropertyTest 对象是PropertyTests 集合中的成员。

使用 PropertyTest 对象

PropertyTests(index) 可返回一个PropertyTest 对象;此处index 是该对象的索引号。以下示例显示PropertyTests 集合中第一个属性测试的所有搜索条件。

With Application.FileSearch.PropertyTests(1)
myString = "This is the search criteria: " _
 & " The name is: " & .Name & ". The condition is: " _
 & .Condition
If .Value <> "" Then
 myString = myString & ". The value is: " & .Value
 If .SecondValue <> "" Then
 myString = myString _
 & ". The second value is: " _
 & .SecondValue & ", and the connector is" _
 & .Connector
 End If
End If
MsgBox myString
End With
FileSearch
PropertyTests (PropertyTest)
FoundFiles