Search code examples
delphiexchange-serveroutlook-redemption

Empty EntryID after using GetMessageFromMsgFile in Outlook Redemption


Using RDO 4.8.0.1184 with Delphi 2006 on Exchange 2007 SP3

I have the following code (abbreviated):

Msg := MailSession.GetMessageFromMsgFile(sTempFile, false);
Msg.UnRead := true;
Msg.Save;
Msg.Move(some_folder);
ShowMessage('EntryID: ' +Msg.EntryID);

The resulting dialogue shows an empty EntryID. I've tried printing the EntryID at various places but it is always an empty string. What am I doing wrong?


Solution

  • Entry ids are only available on the messages that exist in a message store, which is reponsible for opening them given the entry id. There is no MAPI message store for the standalone MSG files.

    Or do you mean you need the entry id of the newly created message? Keep in mind that Move is a function that returns the newly created message:

    Msg = Msg.Move(some_folder);

    ShowMessage('EntryID: ' +Msg.EntryID);