sort by field

  • Thread starter Thread starter Vinnie
  • Start date Start date
V

Vinnie

Hi There,

I am trying to sort all emails in all subfolders using vba.
I've read numerous posts about the sort method, but that doesn't do it
for me. When I enumerate the messages they are sorted, but when I view
them in the outlook explorer they are still not sorted. I want to sort
them by [ReceivedTime].

Is there anyone that knows how the explorer can be updated to show
them sorted??
It should be something like the .currentview method but I can't seem
to find it.
Thanks in advance!!

Happy holidays to all!!
 
Applying the Items.Sort method does not affect the user's view. To change
what the users see, you need to change the sort applied in View.XML for the
view. Compare that property with and without the desired sort and you'll see
what needs to be changed. Outlook 2002 and 2003 only.
 
A sort you apply to an Items collection will only be sorted in that Items
collection, not in the view the user sees. For that to be sorted you'd have
to apply a custom view using XML view code and that would only work for
Outlook 2002 and later. Earlier versions of Outlook don't support XML views.

If you design the view you want using the UI and then read the XML for that
view you will see what you need for that. Then you can add that view using
code from a saved file of that XML and apply the view. See
www.outlookcode.com for information on XML views.
 
Back
Top