Find e-mails in olFolderSentMail

T

Ton Strankinga

Hi,

I like to find e-mails from the inbox and sent mail box in Outlook by
restricting the search criterium to [From] and [To].

The result is, that all e-mails from the inbox are filtered correctly,
however the e-mails from the folder olFolderSentMail are not filtered at
all. In other words no match is found.

The code I am using :

Outlook.MAPIFolder oSentbox =
oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail);

Outlook.Items oItems = oSentbox.Items;

Outlook.Items oRestrictedItems = (Outlook.Items) oItems.Restrict("[To] =
'"+contact+"'"); //Contact is the e-mail address



Regards,

Ton



Ton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top