Filtering Outlook Public Folders with VB
I am trying to use VB to filter mail messages in a public folder based on a substring of the subject line. Unfortunately the Restrict method doesn't seem to like the "Like" operator, returning "Condition is not valid".
MyString = "*" & Table1.Value & "*"
MyClause$ = "[Subject] Like """ & MyString & """"
Set myItems2 = myItems.Restrict(MyClause$)
Does anyone have any tips for using the restrict method in this way? Also, having tried using equals instead (which should return nothing) I have noticed that it does not actually perform the filtering, where do I go from here to apply the filter?
cheers
Mike