0

just trying to work my way around using Redemption; I've got the following code to retrieve the RDOAccounts (Email accounts) from the default Profile:

Profiles profiles = (Profiles)Activator.CreateInstance(Type.GetTypeFromProgID("ProfMan.Profiles"));
Profile defaultProfile = profiles.DefaultProfile;           
//open a RDOSession for this profile
RDOSession session = RedemptionLoader.new_RDOSession();
session.Logon(defaultProfile.Name);
RDOAccounts accounts = session.Accounts;

Where I'm stuck is trying to determine which of the RDOAccount objects is set as the default email account - there doesn't seem to be any property on the object that I can use to see whether it's the default or not.

Anyone done this before?

Xaruth
  • 4,034
  • 3
  • 19
  • 26
Henry C
  • 4,781
  • 4
  • 43
  • 83

3 Answers3

3

Use RDOSession.Accounts collection, in particular RDOAccounts.GetOrder method: http://www.dimastr.com/redemption/RDOAccounts.htm

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • ah okay cool - so RDOAccounts.GetOrder's first account will be the default one? – Henry C Mar 20 '12 at 06:45
  • GetOrder does not seem to work in Office 2013. I have tested it with two Office 365 accounts, changed Store order in Outlook, but Redemption always returned the same account. – Roman Štefko Jun 24 '13 at 11:35
  • What do you see in OutlookSpy (I am also its author) if you click the IOlkAccountManager button, go to the GetOrder tab and select CLSID_OlkStore? – Dmitry Streblechenko Jun 24 '13 at 17:59
0

Use RDOSession.Accounts collection, in particular RDOAccounts.GetOrder method.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
0

I think this works - but if anyone's got a more elegant solution I'd love to hear it!

RDOAccount defaultAccount = session.GetDefaultFolder(rdoDefaultFolders.olFolderInbox).Store.StoreAccount;            
Henry C
  • 4,781
  • 4
  • 43
  • 83