Hello,
It is not clear what code is used for searching Outlook items.
However, you are on the right avenue. The How to: Search for a Phrase in the Body of Items in a Folder
article provides the following sample code for getting that done:
private void DemoSearchBody()
{
string filter;
if (Application.Session.DefaultStore.IsInstantSearchEnabled)
{
filter = "@SQL=" + "\""
+ "urn:schemas:httpmail:textdescription" + "\""
+ " ci_phrasematch 'office'";
}
else
{
filter = "@SQL=" + "\""
+ "urn:schemas:httpmail:textdescription" + "\""
+ " like '%office%'";
}
Outlook.Table table = Application.Session.GetDefaultFolder(
Outlook.OlDefaultFolders.olFolderInbox).GetTable(
filter, Outlook.OlTableContents.olUserItems);
while (!table.EndOfTable)
{
Outlook.Row row = table.GetNextRow();
Debug.WriteLine(row["Subject"]);
}
}
Does it work for you correctly?