On Sun, 13 Feb 2011 16:11:24 GMT, John Curtis wrote in microsoft.public.outlook.program_vba:
>I would like to know if you ever figured out the Date problem. I have a very basic code
>that has incorporated portions of this but I cannot get the most recent email from a
>Specific Sender to pull up. The Macro always pulls up the oldest email.
>
>Here is the line I am struggling with:
>
>Set myItem = myItems.Find("[SenderName] = 'REPORT WRITER' AND [SentOn] = 'Date' AND [Subject] = 'GENERIC'")
As Michael Bauer wrote earlier: have a look at the help pages how to use a date with the .Find method.
Your code, as written, cannot work as intended. At minimum, it should look this:
Set myItem = myItems.Find("[SenderName] = 'REPORT WRITER' AND [SentOn] = " & strDate & " AND [Subject] = 'GENERIC'")
where strDate is a string representation of the date you're interested in. For the needed format of such a string,
you should inspect the .SentOn property of any mail item.