Retrieve Outlook logged-in user SMTP address after connecting through OLE

后端 未结 2 819
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-07 05:12

Exchange Web Services has a ResolveNames() function that I can use to retrieve (among other things) the primary SMTP address for the Active Directory user that logged on to

2条回答
  •  旧巷少年郎
    2020-12-07 06:02

    Why not use Application.Session.CurrentUser.AddressEntry.GetExchangeUser.PrimarySmtpAddress (you would of course need to check for nulls)?

    As for the account order, you can either use Extended MAPI and IOlkAccountManager.GetOrder (you can play with that object in OutlookSpy if you click IOlkAccountManager button) or you can use Redemption and its RDOSession.Accounts.GetOrder method (see http://www.dimastr.com/redemption/RDOAccounts.htm). The first account in the returned collection will be the default one.

提交回复
热议问题