You can use a pseudo-SQL called "DASL" to search Outlook items in VBA (vbscript/Visual Basic for Applications). I never can quite remember the syntax. To interactively discover the syntax:
- Select View/Arrange By/Current View/Customize Current View
- Press the Filter button
- Use the Advanced tab to build your query.
- Use the SQL tab to see the DASL.
One thing I haven’t figured out yet is how to select items that do not have "waiting" as one of the categories. If you build a query using "doesn’t contain" and "waiting", the DASL it builds is "<> ‘waiting’" and that fails if the item has multiple categories.