开发者

Rewrite the RecievedTime property of a Outlook mailitem

Here at my company we use a E-mailclient different then Outlook. When we copy our conversations to the Exchange imap folder, the recievedtime property is set to the current date.

Is it possible to programmaticaly change this property? Currently I get the error that this property is read-only.

My current code:


private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
    foreach (Outlook.Folder Map in Application.Se开发者_如何学Pythonssion.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)
            {
            }
        }
    }
}


We solved this problem by purchasing a program that migrates all items from one e-mailsystem to an other. It's called Transend Migration (http://www.transend.com). The program reads al your e-mails and then writes them back to the new system.

Hope it helps!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜