using word VBA to extract email address

R

red6000

Hi,

is there a way to use use word vba to extract your own email address (the
account is an outlook 2002 account).

Thanks.
 
P

Perry

Set a reference to Outlook object library in VBE and do something like:

Dim ol As New Outlook.Application
Dim ns As Outlook.NameSpace
Set ns = ol.GetNamespace("MAPI")
MsgBox ns.Accounts(1)

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
 
B

Bear

Red6000:

You might also check out the Application.GetAddress method. The Help says:
Returns an address from the default address book.

So you could determine the user's name from Application.UserName and use
that to preload the GetAddress?

Bear
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top