Get Current User

  • Thread starter Thread starter wawa
  • Start date Start date
W

wawa

Hi

How to read out the current user of Outloo
to use it in a code for my userdefined form

I tried this

Set myOlApp = CreateObject("Outlook.Application"
Set myNameSpace = myOlApp.GetNameSpace("MAPI"
MsgBox myNameSpace.CurrentUser.Nam

and this
Set myNameSpace = Application.GetNameSpace("MAPI"
MsgBox myNameSpace.CurrentUser.Nam

The response is in both cases "unkown".
What can be the reason
Or are there other ways to get the current user

User = ???

Thank
 
if you replace currentuser.name with currentuser.address do you get the
current eamil address? The reason I ask is because of exchange server. If the
outlook default account is exchange server, then that is the problem.
 
This single line works like a charm for me -- Exchange 2003 & Outlook
2003 -- on my forms (obviously there is a DIM statement elsewhere):


strUName = UCase(Application.GetNameSpace("MAPI").CurrentUser)
 
Back
Top