Reputation: 6320
The above doesn't work when using Cached Exchange Mode. Outlook only checks the local cache for the message, and since it was just created on the server, it won't be immediately available locally.
However, it works just fine when the account isn't using Cached Exchange Mode, because Outlook checks the Exchange Server for the e-mail.
So, the question:
How do I ensure that Outlook checks the Exchange Server instead of the local cache, or at least syncs with the server before looking for the message?
Here's the (simplified) code we use to display e-mails based on their Entry IDs:
void ShowEmail(string entryId)
{
// (COM release and error handling removed for readability)
var app = new Microsoft.Office.Interop.Outlook.Application();
var ses = app.Session;
var mailItem =
(Microsoft.Office.Interop.Outlook.MailItem)ses.GetItemFromID(entryId);
mailItem.Object.Display(true);
}
Upvotes: 3
Views: 673
Reputation: 31651
You have no control over the upload or sync of the mailbox. See this post. If the user is using Cached Exchange Mode - they can't use this feature.
If you have access to the registry - you could try disabling Cached Exchange Mode, and then re-enabling it. See this post which modifies the registry to enable/disable CEM.
Upvotes: 2