Monday 20 May 2013

Getting Emailid and Username from Outlook



'Creating outlook application object
Set olapp=createobject("Outlook.application") 

'Get Namespace
Set objNS =olApp.GetNamespace("MAPI")  


'Current EMail ID 
msgbox objNS.Session.CurrentUser.AddressEntry.GetExchangeUser.PrimarySmtpAddress

'Current UserName
msgbox objNS.Session.CurrentUser


No comments:

Post a Comment