While it is easy to use the predefined fields in Outlook, they don't give you access to all of the logical operators and supported query formats. You can select field from the ribbon to avoid typing the field name (or until you learn the field name) then edit the query. The More menu contains additional fields to choose from.
Outlook's Search query syntax is used when the Instant Search feature is enabled and follows this basic form:
fieldname:your search criteria value
Use the logical operators AND, NOT, OR, <, >, = refine your search. Logical operators must be typed in uppercase letters.
Below are some of the common queries.
Search by Field Name
In most cases, you can type the Outlook field name (leave out the space in multiple-word field names):
from:john
firstname:mary
Search by Date
To search between two dates use the following format with any date field:
received:(>1/15/2010 AND <4/15/2010)
In the Calendar, use Start:
start:(>1/15/2010 AND <4/15/2010)
To include results from the dates, add an equal sign or use two periods between the dates:
received:(>=1/15/2010 AND <=4/15/2010)
received: (1/15/10..6/15/10)
Search by Item Size
To find messages of a certain size or within a size range use the greater then, less than, and equal signs or two periods:
size:10kb
size:=50KB<60kb
size:3mb..12mb
Operators
In addition to greater than (>), less than (<), and equal symbols (=), you can use comma's, AND, or OR between search terms. from:(mary NOT smith) cc:(mary AND sue) to:(mary OR billy)
Natural Language
Search recognizes days of the week (Sunday, Monday, Tuesday), the months (March, April, May) as well as today, tomorrow, yesterday, week, next month, last week, past month, and coming year. You don’t even need to use the space: thisweek, nextmonth, lastweek, pastmonth, comingyear are valid in Instant Search.
Hi, for some years now I used VBA instantsearch to find all mails to or from a selected mail with scope = olSearchScopeAllOutlookItems. and present the results in a new explorer instance. Recently I added two Exchange stores to Outlook. and noticed that sometimes the search froze for a long time so I tried to use olSearchScopeCurrentStore. This results in displaying a lot of mails, probably all. When I remove and repaste the search string by hand it gives the correct result (but the view is corrupted showing odd fields). Have tried a lot of different tricks, but can't get it working properly.
I'll see if I can repro. You are using cached mode with the exchange accounts, correct?
Yes, cached mode, Actually these are two accounts connected by the Kerio connector (to the same server), so that could pose/cause a problem. I went back to all stores and the freezing does not always happen. So you could wait reproducing, maybe I can find out more. If you could suggest which threads in process-explorer to watch maybe that would help. On the side: the mail I got didn't contain a link to this conversation or blog, only one to unsubscribe.
It is possible to perform an Instant Search for Subject is exactly "Test subject" and not contains "Test subject"? Or does it require a very long string like subject:"Test subject" AND NOT subject:"Other test subject"
I may have answered my own question. I see that subject:"Test subject" NOT subject:"Other test subject" produces the correct results in Windows Outlook 2010, but does not work for Mac Outlook 2011. I assume Instant Search syntax differs for the two versions, but the Mac advanced search option has the "is exactly" parameter I was looking for.
Outlook windows also supports 'is exactly' - it's not case sensitive, so it will find upper or lower case usage of the keyword.
use subject:="test subject"
What's the syntax for a folder with an "empty" name ? I can select this in Advanced Find dialog, but how can I set the filter correctly using VBA ?
Try "" - if that doesn't work, it might be using NULL. If that doesn't work, check the name using MFCMAPI.