items.Sort ordered for more fields

M

MClaudio

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
 
K

Ken Slovak - [MVP - Outlook]

Your code first sorts on "NumeroOrdine", then discards that sort to sort on
"AnnoOrdine". Outlook only allows sorting on one field at a time.
 
K

Ken Slovak - [MVP - Outlook]

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.
 
Top