Find exact e-mail in other users folder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

please, could anyone advise me with my problem ?
My team-mate and me get the same emails. Who answers first should mark the
same email in colleague's folder. I have rule which fires a script. I suceed
to find email in his folder via subject. But I need to add more criterions to
script.

But nothing like recievedtime, senton,CreationTime, size etc. this doesn't
work. Only subject works.

I use this code with time properties:

timebfr = = olMail.ReceivedTime - 0.00001
timeaftr = = olMail.ReceivedTime + 0.00001

Set eml= myFolder.Items.Find("[ReceivedTime] > " & Chr(34) & timebfr &
Chr(34) & " and [ReceivedTime] < " & Chr(34) & timeaftr & Chr(34) & "")


What is wrong ?
Thank you for any help
 
thank you for your interest. Unfortunately it didnt help.
I found the problem is with date and boolean properties. String properties
works OK. Exacttly the problem is not that that the code will not find the
right item, the problem is that the code will stop when i use date or
booleaan properties.
I tested both properties, both are date type.

thank you for any informatin
John



Michael Bauer said:
Search for >= and <=

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Thu, 18 Oct 2007 14:11:01 -0700 schrieb Johny:
Hello,

please, could anyone advise me with my problem ?
My team-mate and me get the same emails. Who answers first should mark the
same email in colleague's folder. I have rule which fires a script. I suceed
to find email in his folder via subject. But I need to add more criterions to
script.

But nothing like recievedtime, senton,CreationTime, size etc. this doesn't
work. Only subject works.

I use this code with time properties:

timebfr = = olMail.ReceivedTime - 0.00001
timeaftr = = olMail.ReceivedTime + 0.00001

Set eml= myFolder.Items.Find("[ReceivedTime] > " & Chr(34) & timebfr &
Chr(34) & " and [ReceivedTime] < " & Chr(34) & timeaftr & Chr(34) & "")


What is wrong ?
Thank you for any help
 
Any date search using Find or Restrict needs to omit the seconds element from the date strings. See http://www.outlookcode.com/article.aspx?id=30. Thus the minimum range in which Outlook can find items is one minute.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Johny said:
Am Thu, 18 Oct 2007 14:11:01 -0700 schrieb Johny:
Hello,

please, could anyone advise me with my problem ?
My team-mate and me get the same emails. Who answers first should mark the
same email in colleague's folder. I have rule which fires a script. I suceed
to find email in his folder via subject. But I need to add more criterions to
script.

But nothing like recievedtime, senton,CreationTime, size etc. this doesn't
work. Only subject works.

I use this code with time properties:

timebfr = = olMail.ReceivedTime - 0.00001
timeaftr = = olMail.ReceivedTime + 0.00001

Set eml= myFolder.Items.Find("[ReceivedTime] > " & Chr(34) & timebfr &
Chr(34) & " and [ReceivedTime] < " & Chr(34) & timeaftr & Chr(34) & "")


What is wrong ?
Thank you for any help
 
Thanks Sue !!
(for other users, this was desired code)

TM = FormatDateTime(mymail.ReceivedTime, vbShortDate) & " " &
FormatDateTime(mymail.ReceivedTime, vbShortTime)
 
Back
Top