How to find a date

I

Ivan

Hy everybody,
I need an help, I have to find in my deault folder some emails recieved
before a particular date, for example 1 Mars 2006.
Set Myitem = Myitems.find(StrSearch)
How should be String StrSearch?

Thanks a lot

Ivan
 
K

Ken Slovak - [MVP - Outlook]

From the Object Browser help on Items.Restrict:

sFilter = "[LastModificationTime] > '" & _

Format("1/15/99 3:30pm", "ddddd h:nn AMPM") & "'"

Modify that to:
sFilter = "[ReceivedTime] < '" & Format("3/1/06 3:30pm", "ddddd h:nn AMPM")
& "'"

Don't use seconds in a filter.
 
I

Ivan

Thank you Sue,
I saw that page, but the example is about the calendar Folder, i'm working
with Inbox folder, VBA returns me an error because it doesn't know the
object [Start], maybe could be another name


"Sue Mosher [MVP-Outlook]" <[email protected]> ha scritto nel messaggio
See http://www.outlookcode.com/d/finddate.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
I

Ivan

That's the way!
Thank you Ken
Have a nice week end
Ken Slovak - said:
From the Object Browser help on Items.Restrict:

sFilter = "[LastModificationTime] > '" & _

Format("1/15/99 3:30pm", "ddddd h:nn AMPM") & "'"

Modify that to:
sFilter = "[ReceivedTime] < '" & Format("3/1/06 3:30pm", "ddddd h:nn
AMPM") & "'"

Don't use seconds in a filter.




Ivan said:
Hy everybody,
I need an help, I have to find in my deault folder some emails recieved
before a particular date, for example 1 Mars 2006.
Set Myitem = Myitems.find(StrSearch)
How should be String StrSearch?

Thanks a lot

Ivan
 
S

Sue Mosher [MVP-Outlook]

The basic syntax, which Ken also gave you, applies to any date field.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Ivan said:
Thank you Sue,
I saw that page, but the example is about the calendar Folder, i'm working
with Inbox folder, VBA returns me an error because it doesn't know the
object [Start], maybe could be another name


"Sue Mosher [MVP-Outlook]" <[email protected]> ha scritto nel messaggio
See http://www.outlookcode.com/d/finddate.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Ivan said:
Hy everybody,
I need an help, I have to find in my deault folder some emails recieved
before a particular date, for example 1 Mars 2006.
Set Myitem = Myitems.find(StrSearch)
How should be String StrSearch?

Thanks a lot

Ivan
 

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