搜索电子邮件正文内容

编程入门 行业动态 更新时间:2024-10-28 11:30:52
本文介绍了搜索电子邮件正文内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好,

我想搜索电子邮件正文内容。我正在使用 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?

更多推荐

搜索电子邮件正文内容

本文发布于:2023-06-09 04:15:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/595038.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:电子邮件   内容   正文

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!