在處理電子郵件並將數據輸入到數據庫中時,我需要按照收到的時間對郵件進行排序。按照收到的時間對郵件進行排序處理C#Outlook
我需要它,所以最新收到的電子郵件將被放入數據庫中以覆蓋舊版本(如果存在舊版本的話)。
Microsoft.Office.Interop.Outlook.Items item =(Outlook.Items)source.Items;
來源是,我想整理
在它的電子郵件文件夾我已經嘗試了這四種方式:
items.Sort("ReceivedTime", false);
items.Sort("[ReceivedTime]", Outlook.OlSortOrder.olAscending);
items.Sort("ReceivedTime", Outlook.OlSortOrder.olSortNone);
items.Sort("[ReceivedTime]");
似乎這不排序,因爲它仍然把最古老的入數據庫第二,覆蓋最新的提交。
任何想法?
Microsoft.Office.Interop.Outlook.Items item =(Outlook.Items)source.Items; 源是我想要排序的電子郵件文件夾。 所以這不會像Sort所帶參數那樣工作。 – Mac