473,326 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

outlook items "addition time"

I am grabbing Outlook MailItems using the Items[] property on my
Outlook inbox. When I iterate through them, I notice that they are
not ordered in ReceivedTime or CreationTime order. For example,

Items[2].ReceivedTime is April 2005
Items[3].ReceivedTime is May 2005
Items[4].ReceivedTime is October 2005
Items[5].ReceivedTime is June 2005

I did some experiments and the following seems to explain how
out-of-order MailItems could happen: assuming I have n items in
my Inbox, if I delete a piece of mail, go to the Trash folder, and
move the just-deleted mail back to the Inbox, the index of the mail
is not its original index, but n. Which makes perfect sense.
The piece of mail was removed from the Items queue, and then
added to the end of the queue, hence its index is the top (n).
All cool with me.

BUT

I need some way to iterate through the emails, stopping when
I reach some date threshold. The reason is, the clients have
HUGE inboxes, like 15,000 emails, and I want to only look at
the ones within the last month. Unfortunately, CreationTime,
LastModificationTime and DeferredDeliveryTime all generally
have the same value as ReceivedTime, which means I can't
just walk my way through Items until I reach something earlier
than last month and then stop (because Items is out-of-order,
hence something from this month might be after that).

Any ideas for how to walk through the Items array, finding just
the items from this month, without searching through all
15,000 emails?

Thanks,
Harold

Nov 21 '05 #1
2 2769
Harold,

Have you checked the Sort property on the Items collection? It will
allow you to sort the list by a certain field.

Also, you might want to consider using the Find and FindNext methods on
the Items collection, as they will iterate from the current item through the
list, and find the items that correspond to the criteria that you specify.

I mention the Find and the FindNext methods because if you do a sort
operation, you are going to have to iterate through the list somehow in
order to sort the items in the first place. If you are going to do that,
then iterate through some number of items to determine which ones are
applicable, you might as well just iterate through the whole list once with
Find and FindNext.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<hs****@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I am grabbing Outlook MailItems using the Items[] property on my
Outlook inbox. When I iterate through them, I notice that they are
not ordered in ReceivedTime or CreationTime order. For example,

Items[2].ReceivedTime is April 2005
Items[3].ReceivedTime is May 2005
Items[4].ReceivedTime is October 2005
Items[5].ReceivedTime is June 2005

I did some experiments and the following seems to explain how
out-of-order MailItems could happen: assuming I have n items in
my Inbox, if I delete a piece of mail, go to the Trash folder, and
move the just-deleted mail back to the Inbox, the index of the mail
is not its original index, but n. Which makes perfect sense.
The piece of mail was removed from the Items queue, and then
added to the end of the queue, hence its index is the top (n).
All cool with me.

BUT

I need some way to iterate through the emails, stopping when
I reach some date threshold. The reason is, the clients have
HUGE inboxes, like 15,000 emails, and I want to only look at
the ones within the last month. Unfortunately, CreationTime,
LastModificationTime and DeferredDeliveryTime all generally
have the same value as ReceivedTime, which means I can't
just walk my way through Items until I reach something earlier
than last month and then stop (because Items is out-of-order,
hence something from this month might be after that).

Any ideas for how to walk through the Items array, finding just
the items from this month, without searching through all
15,000 emails?

Thanks,
Harold

Nov 21 '05 #2
Have you considered using either Items.Sort or Items.Restrict?

--
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
<hs****@gmail.com> wrote in message news:11**********************@g14g2000cwa.googlegr oups.com...
I am grabbing Outlook MailItems using the Items[] property on my
Outlook inbox. When I iterate through them, I notice that they are
not ordered in ReceivedTime or CreationTime order. For example,

Items[2].ReceivedTime is April 2005
Items[3].ReceivedTime is May 2005
Items[4].ReceivedTime is October 2005
Items[5].ReceivedTime is June 2005

I did some experiments and the following seems to explain how
out-of-order MailItems could happen: assuming I have n items in
my Inbox, if I delete a piece of mail, go to the Trash folder, and
move the just-deleted mail back to the Inbox, the index of the mail
is not its original index, but n. Which makes perfect sense.
The piece of mail was removed from the Items queue, and then
added to the end of the queue, hence its index is the top (n).
All cool with me.

BUT

I need some way to iterate through the emails, stopping when
I reach some date threshold. The reason is, the clients have
HUGE inboxes, like 15,000 emails, and I want to only look at
the ones within the last month. Unfortunately, CreationTime,
LastModificationTime and DeferredDeliveryTime all generally
have the same value as ReceivedTime, which means I can't
just walk my way through Items until I reach something earlier
than last month and then stop (because Items is out-of-order,
hence something from this month might be after that).

Any ideas for how to walk through the Items array, finding just
the items from this month, without searching through all
15,000 emails?

Thanks,
Harold

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: a_geek | last post by:
Hello, I'm writing a small program that needs to check Unix timestamps for falling into an interval (typical usage: ./program 2005-03, you get the idea). Now, I create two time stamps from the...
16
by: PK9 | last post by:
I have a string variable that holds the equivalent of a DateTime value. I pulled this datetime from the database and I want to strip off the time portion before displaying to the user. I am...
22
by: Qopit | last post by:
Hi there, I'm pretty new to Python and am trying to figure out how to get "will this code compile?"-like code checking. To me this is a pretty basic language/environment requirement, especially...
9
by: rnn98 | last post by:
hi, my multithread application, running under solaris box, is crashing eventually. I tried to spot and substitute functions not "thread safe", but I guess my search wasn't good enough. I have put...
2
by: Micah Williamson | last post by:
Does anyone know how to make it so that a time entered as a string, and stored in a string record in an access 2000 database can be kept as a string? When ever I enter a time like 1:00:00 PM...
16
by: John Kelsey | last post by:
Back in the "old" days with C, I used to do something like... struct { char Description; float price; } Items = { {"Apple", 1.99}, {"Banana", 2.04}
3
by: rdudejr | last post by:
Hi all, Ive got a database approx 350 GB in which Im getting very high Time waited for prefetch. This is directly out of the snapshot for the db (these are for the entire database I assume as I...
4
by: Mike Copeland | last post by:
How do I mask out all but the _time_ components of a time_t value? Specifically, I have the following: time_t wTime = 1226764757; I happen to know that this is November 16, 2008 @ 8:59:17, but I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.