Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2006

Tip: Looking for answers? Try searching our database.

Users mail adress(es)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bo Hansson - 19 Feb 2006 16:33 GMT
Is there a way to find the mail adress(es) of the current user?

/BosseH
Doug Robbins - Word MVP - 19 Feb 2006 17:04 GMT
The following will return the email address for the default mail account:

Dim olook As Outlook.Application
Dim bStarted As Boolean
On Error Resume Next

Set olook = GetObject(, "Outlook.Application")

If Err <> 0 Then
   Set olook = CreateObject("Outlook.Application")
   bStarted = True
End If

MsgBox olook.Session.CurrentUser.Address

'  Close Outlook if it was started by this macro.

If bStarted Then

   oOutlookApp.Quit

End If

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Is there a way to find the mail adress(es) of the current user?
>
> /BosseH
Bo Hansson - 19 Feb 2006 17:51 GMT
Many thanks!

/BosseH

> The following will return the email address for the default mail account:
>
[quoted text clipped - 22 lines]
>>
>> /BosseH
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.