我正在扫描“已发送电子邮件”中是否有发送到特定电子邮件地址的电子邮件。我的问题是,一旦会议邀请被点击,下一行的调试错误“类型不匹配”
下面是我的完整代码-有人可以显示我应该如何修改我的代码以使其按需执行吗?
Function rst()
Dim searchEmail As String
Dim olApp As Outlook.Application
Dim olNS As Namespace
Dim Fldr As MAPIFolder
Dim olMail As Outlook.MailItem
Dim olReply As Outlook.MailItem
Set olApp = New Outlook.Application
Set olNS = olApp.GetNamespace(“MAPI”)
Set Fldr = olNS.GetDefaultFolder(olFolderSentMail)
For Each olMail In Fldr.Items
If olMail.To = searchEmail Then
Debug.Print “Found It”
End If
Next olMail
End Function