PDA

View Full Version : Filter email folder according to field



Nikitas10
11-12-2010, 05:49 AM
Hello,
I want to isolate some emails from my sent folder according to subject. Because the search through all the sent emails takes way too long, I want to search only through emails sent in 2010!

I set my folder fld correctly and I'm trying to set a filter:

strFind = "[SentOn] > ' " & Format("01/01/10 0:00pm", "ddddd h:nn AMPM") & "'"

Set itms = fld.Items.Restrict(strFind)

Then, I create a loop through all of the items found:

For Each itm In fld.Items
'rest of code...

The procedure does not work and I get all emails from my Sent folder. Can you please help me on how to isolate the items of the folder sent on specific date? Thank you

Charlize
11-14-2010, 03:52 PM
Set itms = fld.Items.Restrict(strFind)

Then, I create a loop through all of the items found:

For Each itm In fld.Items
'rest of code...

The procedure does not work and I get all emails from my Sent folder. Can you please help me on how to isolate the items of the folder sent on specific date? Thank youMaybe try to loop through the filtered list instead of all your items in the folderFor Each itm in itmsbecause itms is the collection of all your filtered items of the folder and not fld.items (that's all the items of the folder without restriction).

Charlize