搜索电子邮件正文内容 [英] Search Email Body Content

查看:245
本文介绍了搜索电子邮件正文内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

   我想搜索电子邮件正文内容。我正在使用  urn:schemas:httpmail:textdescription。但它也搜索附件中的文本。如何仅搜索电子邮件正文邮件?

    I want to search for Email Body content. I am using urn:schemas:httpmail:textdescription. But it searches the text in attachments too. How to search only email only email body text?

谢谢

推荐答案

您好,

目前尚不清楚用于搜索Outlook项目的代码。

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?


这篇关于搜索电子邮件正文内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆