Outlook 2010 Categories

Add-in Express™ Support Service
That's what is more important than anything else

Outlook 2010 Categories
Categorise mails 
Spiros Nikolopoulos


Guest


Why the following code set the category only in one of the selected mails in outlook 2010?



for mlNo := 0 to length(SelectedItems) - 1 do //selected mails loop
 Begin
  MailItem(SelectedItems[mlNo]).Categories := 'Archived'
 end;
Posted 04 Jul, 2012 09:00:46 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hi Spiros,

All Office collections are 1-based:

for mlNo := 1 to length(SelectedItems) do //selected mails loop   
 Begin   
  MailItem(SelectedItems[mlNo]).Categories := 'Archived'  
 end;  



Andrei Smolin
Add-in Express Team Leader
Posted 04 Jul, 2012 09:57:01 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Oh, Spiros,

I'm sorry, I was wrong; I missed the fact that you use an array, not the Selection object.

I suggest that you save every item after setting the category.


Andrei Smolin
Add-in Express Team Leader
Posted 04 Jul, 2012 10:58:00 Top
Spiros Nikolopoulos


Guest


OOps This need to be saved !
Thanks Andrei
Posted 05 Jul, 2012 02:23:12 Top