Sorting Selected mail items

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

Guest

Hello,
i am trying to display a selected list of mail items by their created date.

it seems that the SORT method is not working on selected object.

any idea how to do it?

Thanks
David
 
CombinedBodyStr = ""
Set Sel = Application.Active.Explorer.Selection

Sel.Sort "[CreationTime]", True ' <-- THIS ONE FAILS

for each Item in Sel
CombinedBodyStr = CombinedBodyStr & Item.Body & VBcRLf
next

'Print the CombinedBodyStr to a text file

David
 
Ah, you're trying to use Sort on the Selection object. Selection always uses
whatever sort is present in the user interface. Even though it otherwise
acts like an Items collection, it doesn't support the Sort method like Items
does.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



David said:
CombinedBodyStr = ""
Set Sel = Application.Active.Explorer.Selection

Sel.Sort "[CreationTime]", True ' <-- THIS ONE FAILS

for each Item in Sel
CombinedBodyStr = CombinedBodyStr & Item.Body & VBcRLf
next

'Print the CombinedBodyStr to a text file

David

Sue Mosher said:
Show your code.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top