Ooh, that's a juicy little tidbit! Thanks Ken.
--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog:
http://blogs.officezealot.com/legault/
"Ken Slovak - [MVP - Outlook]" wrote:
Eric, the syntax can be used with Restrict, a neat little undocumented plus:
strRestrict = "@SQL=" ' then add the filter to that. no spaces.
oItems.Restrict(strRestrict)
So LIKE can be used in a Restrict clause 
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Eric Legault [MVP - Outlook]" wrote in
message ...
Yes, you can use the LIKE predicate, but only with the AdvancedSearch
object,
not the Restrict method.
Here's a sample from the Outook VBA Reference:
Public blnSearchComp As Boolean
Private Sub Application_AdvancedSearchComplete(ByVal SearchObject As
Search)
MsgBox "The AdvancedSearchComplete Event fired"
blnSearchComp = True
End Sub
Sub TestAdvancedSearchComplete()
Dim sch As Outlook.Search
Dim rsts As Outlook.Results
Dim i As Integer
blnSearchComp = False
Const strF As String = "urn:schemas:httpmail:subject LIKE '%mykeyword%'"
Const strS As String = "Inbox"
Set sch = Application.AdvancedSearch(strS, strF)
While blnSearchComp = False
DoEvents
Wend
Set rsts = sch.Results
For i = 1 To rsts.Count
MsgBox rsts.Item(i).SenderName
Next
End Sub
--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/