'get message id of sent item from exchange in cache mode in outlook
I am getting message id (using propertyaccessor) in outlook for microsoft exchange emails for sent items if not using cached mode.
But, in cached mode, it is empty.
How to get it in cached mode ?
Solution 1:[1]
The cached store does not sync that property from the Exchange store for the Sent Items folder - it is a performance optimization: when a message is sent in the cached mode, Outlook hands it over to the server, and creates a sent message in the local copy of the Sent Items folder. Server sends the message and creates a message in the server version of the folder. In theory, the two messages look the same to the user and do not need to be synchronized. But the message id is of course missing from the local copy.
On the low (Extended MAPI) level, you would need to reopen the message in the online mode using the MAPI_NO_CACHE flag. You cannot do this using the Outlook Object Model alone or Extended MAPI (since it requires C++ or Delphi). If using Redemption (I am its author) is an option, it will let you reopen a message in the online mode. In VB script, you could do the following (C# would be very similar):
MAPI_NO_CACHE = &H200
MAPI_BEST_ACCESS = &H10
PR_INTERNET_MESSAGE_ID_W = "http://schemas.microsoft.com/mapi/proptag/0x1035001F"
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Msg = Session.GetMessageFromID(Application.ActiveExplorer.Selection(1).EntryID, , MAPI_NO_CACHE + MAPI_BEST_ACCESS)
MsgBox Msg.Fields(PR_INTERNET_MESSAGE_ID_W)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |