Search code examples
mapioutlook-redemption

Redemption LogonHostedExchangeMailbox


I am trying to access an Exchange Item using Redemption 5.8.0.4036.

Here's sample code:

var rdoSession = new Redemption.RDOSession();
rdoSession.LogonHostedExchangeMailbox(smtpAddress, credentials.UserName, credentials.Password);
var folder = rdoSession.GetDefaultFolder(Redemption.rdoDefaultFolders.olFolderInbox);
var rdoMail = rdoSession.GetMessageFromID(id, folder.Store);

I keep getting a:

System.Runtime.InteropServices.COMException (0x8000FFFF): Could not convert variant of type (Dispatch) into type (String) at Redemption.IRDOSession.GetMessageFromID(String EntryIDMessage, Object EntryIDStore, Object Flags)

I have looked everywhere but short on ideas. The Entry ID (id) is correct as I have verified it using MFC Mapi.

What could I be doing wrong? How to get past this exception and get the Message Item given its EntryID and using LogonHostedExchangeMailbox.


Solution

  • Change the line

    var rdoMail = rdoSession.GetMessageFromID(id, folder.Store);
    

    to

    var rdoMail = rdoSession.GetMessageFromID(id, folder.StoreID);