Current Outlook user && Active Directory
-
Thursday, December 01, 2011 2:03 PMHow to get active directory info with current Outlook user?
All Replies
-
Thursday, December 01, 2011 2:09 PM
What kind of info?
Have you tried the Application.Session.CurrentUser property?
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.2 is now available!
-
Thursday, December 01, 2011 2:27 PM
Yes. But I get RecipientHave you tried the Application.Session.CurrentUser property?
I need domain user name.What kind of info?
-
Thursday, December 01, 2011 2:35 PM
Try Recipient.AddressEntry.GetExchangeUser.Alias
Be prepared to handle situations when AddressEntry.GetExchangeUser returns null.
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.2 is now available!
-
Thursday, December 01, 2011 2:48 PM
Alias consist of only user name without domain name.Try Recipient.AddressEntry.GetExchangeUser.Alias
-
Thursday, December 01, 2011 6:36 PM
Yes, Outlook only returns the contents of the PR_ACCOUNT property, which only contains the login name.
You can either use MAPI (C++ or Delphi) to retrieve the PR_EMS_AB_ASSOC_NT_ACCOUNT property and use it to call LookupAccountSid() or use Redemption, which exposes the RDOAddressEntry.NTAccountName property:
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
MsgBox Session.CurrentUser.NTAccountNameDmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.2 is now available!
- Marked As Answer by Tom_Xu_WXModerator Wednesday, December 07, 2011 10:05 AM

