本文介绍了搜索电子邮件正文内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我想搜索电子邮件正文内容。我正在使用 urn:schemas:httpmail:textdescription。但它也搜索附件中的文本。如何仅搜索电子邮件正文邮件?
I want to search for Email Body content. I am usingurn: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. TheHow 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?
更多推荐
搜索电子邮件正文内容
发布评论