PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming How to find a date

Reply

How to find a date

 
Thread Tools Rate Thread
Old 17-03-2006, 01:48 PM   #1
Ivan
Guest
 
Posts: n/a
Default How to find a date


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


  Reply With Quote
Old 17-03-2006, 02:16 PM   #2
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: How to find a date

See http://www.outlookcode.com/d/finddate.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Ivan" <anonymous> wrote in message news:uZ890lcSGHA.3944@TK2MSFTNGP10.phx.gbl...
> 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
>
>

  Reply With Quote
Old 17-03-2006, 03:16 PM   #3
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: How to find a date

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ivan" <anonymous> wrote in message
news:uZ890lcSGHA.3944@TK2MSFTNGP10.phx.gbl...
> 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
>


  Reply With Quote
Old 17-03-2006, 03:58 PM   #4
Ivan
Guest
 
Posts: n/a
Default Re: How to find a date

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]" <suemvp@outlookcode.com> ha scritto nel messaggio
news:ezs1nZdSGHA.3192@TK2MSFTNGP09.phx.gbl...
See http://www.outlookcode.com/d/finddate.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Ivan" <anonymous> wrote in message
news:uZ890lcSGHA.3944@TK2MSFTNGP10.phx.gbl...
> 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
>
>



  Reply With Quote
Old 17-03-2006, 04:27 PM   #5
Ivan
Guest
 
Posts: n/a
Default Re: How to find a date

That's the way!
Thank you Ken
Have a nice week end
"Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> ha scritto nel messaggio
news:%23yzHogdSGHA.1572@tk2msftngp13.phx.gbl...
> 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.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "Ivan" <anonymous> wrote in message
> news:uZ890lcSGHA.3944@TK2MSFTNGP10.phx.gbl...
>> 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
>>

>



  Reply With Quote
Old 18-03-2006, 12:22 AM   #6
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: How to find a date

The basic syntax, which Ken also gave you, applies to any date field.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Ivan" <anonymous> wrote in message news:e1KcpudSGHA.424@TK2MSFTNGP12.phx.gbl...
> 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]" <suemvp@outlookcode.com> ha scritto nel messaggio
> news:ezs1nZdSGHA.3192@TK2MSFTNGP09.phx.gbl...
> See http://www.outlookcode.com/d/finddate.htm
>
> --
> Sue Mosher, Outlook MVP
> Author of Configuring Microsoft Outlook 2003
> http://www.turtleflock.com/olconfig/index.htm
> and Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
> "Ivan" <anonymous> wrote in message
> news:uZ890lcSGHA.3944@TK2MSFTNGP10.phx.gbl...
>> 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
>>
>>

>
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off