开发者

Outlook Add-in,group emails based on color category

开发者 https://www.devze.com 2023-02-11 03:12 出处:网络
I need to set the sub folder group by property through my c# outlook add-in code basically, i got mails in the folder with different color categories.i need to sort them through my code

I need to set the sub folder group by property through my c# outlook add-in code

basically, i got mails in the folder with different color categories.i need to sort them through my code

Initially i thought of sorting:

Microsoft.Office.Interop.Outlook.Items oItems =m_Outlook.Inbox.Items; oItems.Sort("[Categories]");

开发者_如何学Godosnt work... :( Pretty much lost here

Also trying bubble sorting :

but cant assign mail item to next index

object objMessage = subFolder.Items[counter]; object objNextMessage = subFolder.Items[counter + 1];

subFolder.Items[counter] = objNextMessage; subFolder.Items[counter + 1] = objNextMessage;

Error: Property or indexer 'Microsoft.Office.Interop.Outlook._Items.this[object]' cannot be assigned to -- it is read only


Sorting seemed a difficult option so i thought of grouping . how do i go about it ?

Cheers! Rajat


Sort will re-order the items in the collection but won't update the view:

http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._items.sort.aspx

You'd need to set the collection to be displayed again after sorting.

0

精彩评论

暂无评论...
验证码 换一张
取 消