PDA

View Full Version : Sort an outlook selection



Cloud02
07-27-2008, 03:12 AM
Hi guys, i'm hoping for a wee bit of help here.

I've created a macro that takes the information from an e-mail and registers it an excel sheet, and then moves the e-mail from the inbox to a "registered folder".
This is also done if there's multiple e-mails selected, since the way i access the e-mails is via Application.ActiveExplorer.Selection , however i run into a bit of a problem.

When there's multiple e-mails selected it registers them in the sort order of the inbox. How i'd like to have them sorted is always via received time, so the oldest gets registered first, regardless if the user is sorting on subject or whatever.

Anyone who has an idea how the selection can be sorted?

Mavyak
07-27-2008, 08:19 PM
You could create an ADODB.Recordset and write all the email info to that. Then you could sort it and use the CopyFromRecordset method of the Range object in Excel.