Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook item sort

Status
Not open for further replies.

i12hvfun

Programmer
Jul 26, 2002
20
0
0
SG
Hi, how can I sort the email in Outlook2000 by receive date, or sender?
Thanks!
 
i12hvfun

I don't think that is possible, unless you store them in a cursor or an array and sort that. Or set a filter on a date range to only deal with the ones you need.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
i12hvfun:

I'm not sure this is what you want, just try it

----------------------
#DEFINE olFolderInbox 6

oOutlook = CreateObject('Outlook.Application')
oNS = oOutlook.GetNamespace('MAPI')
oInbox = oNS.GetDefaultFolder(olFolderInbox)
oItems = oInbox.Items

*** Sort by receive date & time
oItems.Sort('ReceivedTime')
oItem = oItems.Item(1)
? oItem.SenderName
? oItem.Subject
? oItem.ReceivedTime

*** Sort by Sender
oItems.Sort('SenderName')
oItem = oItems.Item(1)
? oItem.SenderName
? oItem.Subject
? oItem.ReceivedTime
----------------------

Hope it helps

-- AirCon --
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top