2010-07-19 39 views
0

在我的公司,我們使用與Outlook不同的電子郵件客戶端。當我們將會話複製到Exchange imap文件夾時,recievedtime屬性設置爲當前日期。重寫Outlook mailitem的RecievedTime屬性

是否有可能通過編程來改變這個屬性?目前我收到此屬性爲只讀的錯誤。

我當前的代碼:


private void ThisAddIn_Startup(object sender, System.EventArgs e) 
{ 
    foreach (Outlook.Folder Map in Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox).Folders) 
    { 
     if (Map.Name != "some_name") 
      continue; 
     if (MessageBox.Show("mes", "title", MessageBoxButtons.OKCancel) != DialogResult.OK) 
      break; 
     foreach (Object Item in Map.Items) 
     { 
      try 
      { 
       String Message = ""; 
       Outlook.MailItem Mail = (Outlook.MailItem)Item; 
       Message += "Sent by: \"" + Mail.SenderName + "\" \n"; 
       Message += "Sent on: " + Mail.SentOn.ToString() + "\n"; 
       Message += "Received on: " + Mail.ReceivedTime.ToString(); 
       MessageBox.Show(Message); 

       Mail.ReceivedTime = Mail.SentOn; 
       //Property or indexer 'Microsoft.Office.Interop.Outlook._MailItem.ReceivedTime' cannot be assigned to: it is read only 
      } 
      catch (Exception Exception) 
      { 
      } 
     } 
    } 
} 

回答

0

我們通過購買遷移從一個E-mailsystem所有項目的其他程序解決了這個問題。它被稱爲Transend遷移(http://www.transend.com)。該程序會讀取您的電子郵件,然後將它們寫回新系統。

希望它有幫助!