Outlook 2007有时会使用引号包装收件人地址 [英] Outlook 2007 wraps recipient address with quotation marks sometimes

查看:406
本文介绍了Outlook 2007有时会使用引号包装收件人地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从我的电子邮件发送邮件到
xyz@abc.nl 。在我的olFolderSentMail中,有时邮件注册为:
'xyz@abc.nl',有时也注册为:
xyz@abc.nl

I sent mails from my emailadres to xyz@abc.nl. In my olFolderSentMail sometimes a mail is registered as To: 'xyz@abc.nl' and sometimes as To: xyz@abc.nl.

我想在我的olFolderSentMail中搜索电子邮件
'xyz@abc.nl'

Dim oInbox
As Microsoft.Office.Interop.Outlook。 MAPIFolder = oNS.GetDefaultFolder(Microsoft.Office.Interop.Outlook。< span style ="color:#2b91af"> OlDefaultFolders
.olFolderSentMail)

Dim oInbox As Microsoft.Office.Interop.Outlook.MAPIFolder = oNS.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderSentMail)

Dim oItems
As Microsoft.Office.Interop.Outlook。项目
= oInbox.Items

Dim oItems As Microsoft.Office.Interop.Outlook.Items = oInbox.Items

Dim oSent
作为 对象

Dim oSent As Object

暗淡 过滤器
作为 字符串 =
" [To] ="
& Chr(39)& " xyz@abc.nl" & Chr(39)&
"

Dim Filter As String = "[To] = " & Chr(39) & "xyz@abc.nl" & Chr(39) & "

oSent = oItems.Find(Filter)

找不到邮件。

当我检查所有邮件时:

用于 Tel = 1
To oItems.Count

For Tel = 1 To oItems.Count

暗淡 oMl
As Microsoft.Office.Interop.Outlook。 MailItem

Dim oMl As Microsoft.Office.Interop.Outlook.MailItem

oMl = oItems(Tel)

oMl.To =
"" & Chr(39)&
" xyz@abc.nl"
& Chr(39)& ""
然后

oMl.To = "" & Chr(39) & "xyz@abc.nl" & Chr(39) & "" Then

停止

结束
如果

End If

下一步

找到我的邮件。

为什么.Find不起作用?

Why .Find does not work?

Willem de Ridder

Willem de Ridder

推荐答案

Willem,

Hi Willem,

感谢您在MSDN论坛上发帖。

Thanks for posting in the MSDN Forum.

我建议您使用Items.Restrict而不是Items.Find。根据我的经验,Restrict比Find更强大。并且Find需要非常严格的检索条件,任何不匹配都会导致它返回null。

I would recommend you use Items.Restrict instead of Items.Find. It's based on my experience that Restrict is more powerful than Find. And Find need very strict conditions for retrieve, any mismatch will lead it return null.

祝你有个美好的一天,

Tom


这篇关于Outlook 2007有时会使用引号包装收件人地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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