D
deko
I use automation with Access 2003 to search and inspect email messages (to
get sender, recipients, etc.) in Outlook folders. But if a message is
encrypted or digitally signed, it cannot be inspected. I want to test to
see if a message is encrypted or digitally signed so I can skip or otherwise
indicate in the search results that some messages could not be inspected.
What is happening now is that when the For Loop comes to an encrypted or
digitally signed message, it gets a Type Mismatch error and exits the loop -
so the search is incomplete, especially if the error is received early in
the search. Here is the For Loop I am using:
Dim olmi As Outlook.MailItem
Dim olrs As Outlook.Recipients
Dim olR as Outlook.Recipient
strE = email address I am looking for
For Each olmi In olFolder.Items 'look at every message in folder
Set olrs = olmi.Recipients
For Each olR In olrs
'check every recipient the message was sent to
If olR.Address = strE And olmi.SenderEmailAddress <> olR.Address
Then
[code omitted]
Next
'check sender address
If strFn <> "Sent Items" And olmi.SenderEmailAddress = strE Then
[code omitted]
End If
Next olmi
What property can I inspect to check to see if a message is digitally signed
or encrypted? Or is it possible to automate Outlook in some way so I don't
have to use this loop, but rather use Outlook's own search capabilities?
Thanks in advance.
get sender, recipients, etc.) in Outlook folders. But if a message is
encrypted or digitally signed, it cannot be inspected. I want to test to
see if a message is encrypted or digitally signed so I can skip or otherwise
indicate in the search results that some messages could not be inspected.
What is happening now is that when the For Loop comes to an encrypted or
digitally signed message, it gets a Type Mismatch error and exits the loop -
so the search is incomplete, especially if the error is received early in
the search. Here is the For Loop I am using:
Dim olmi As Outlook.MailItem
Dim olrs As Outlook.Recipients
Dim olR as Outlook.Recipient
strE = email address I am looking for
For Each olmi In olFolder.Items 'look at every message in folder
Set olrs = olmi.Recipients
For Each olR In olrs
'check every recipient the message was sent to
If olR.Address = strE And olmi.SenderEmailAddress <> olR.Address
Then
[code omitted]
Next
'check sender address
If strFn <> "Sent Items" And olmi.SenderEmailAddress = strE Then
[code omitted]
End If
Next olmi
What property can I inspect to check to see if a message is digitally signed
or encrypted? Or is it possible to automate Outlook in some way so I don't
have to use this loop, but rather use Outlook's own search capabilities?
Thanks in advance.