The first thing you should mind is that the Restrict()
method does not evaluate the variable by it's name. You will have to concatenate the variable to the string.
Another one is, if you look at the example from MSDN site, you will see that there is not support for wildcards, so you will have to use the SQL syntax and the searched text in the filter expression must be between quotes.
' this namespace is for Subject
filterStr = "@SQL=""http://schemas.microsoft.com/mapi/proptag/0x0037001f"" like '%" & Findvariable & "%'"
It seems that urn:schemas:httpmail:subject
also works and is easier to understand, but I can't confirm this now:
filterStr = "@SQL=""urn:schemas:httpmail:subject"" like '%" & Findvariable & "%'"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…