items.Sort ordered for more fields

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

Guest

Hi,

I cannot sort items in my folder for more fields ?!?
Why ?

Set MyArchivio =
Application.GetNamespace("MAPI").Folders("CartellePubbliche").Folders("Tutte
le cartelle pubbliche")..Folders("Societa")

set MyItems=MyArchivio.Items
MyItems.Sort "NumeroOrdine"
MyItems.Sort "AnnoOrdine"

When i read Myitems with for Each the elements isn't ordered.

Thanks
 
Your code first sorts on "NumeroOrdine", then discards that sort to sort on
"AnnoOrdine". Outlook only allows sorting on one field at a time.
 
You'd have to abandon using the Outlook object model's Items.Sort method and
code your own multiple column sorting procedure, then pass the Items
collection to that user defined procedure.
 
Back
Top