email address using Outlook object

R

ravi_pv

Hi all,

It has been quit interesting, exploring various option in
integration Exchange server, outlook and my .net
application.
The requirement is quite simple. I need to get all the e-
mail address form the global address list.
I m forced to use Microsoft Outlook 9.0 object library
ahead of MAPI as .Net frame work dnt not support MAPI.
I m able to connect the the Global Address book, but
unable to retrive the email address. I m able to get the
name, display time and all basic stuff other then e-mail
address.

Dim oApp As Outlook.Application = New Outlook.Application
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
oNS.Logon("MyProfile", Missing.Value, False, True)
Dim oDLs As Outlook.AddressLists = oNS.AddressLists
Dim oGal As Outlook.AddressList = oDLs.Item("Global
Address List")
Dim sDL As String = "MyDistributionList"
Dim oEntries As Outlook.AddressEntries =
oGal.AddressEntries
Dim oDL As Outlook.AddressEntry = oEntries.Item(sDL)

Response.Write(oDL.Name & "<br>")
Response.Write(oDL.Address & "<br>")
Response.Write(oDL.Manager)


But Address method provides me somthing like
/o=ABC/ou=SINGAPORE-FB/cn=Recipients/cn=thsnewgroup

where as i expect the email address ([email protected])
format form the address method.

There are many articles that say was can get it using MAPI
object. Since .Net dnt support MAPI and we have some
authentication problem with using MAPI in ASP.net. we are
looking in using Outlook Object.

So the question is, is it possible to get the email
address using the Microsoft Outlook 9.0 object?

thanks and regards,
s. ravi
 
S

Sue Mosher [MVP-Outlook]

So the question is, is it possible to get the email
address using the Microsoft Outlook 9.0 object?

Not the SMTP address for an Exchange mailbox, only the X.400 address. To get
the SMTP address from an Exchange sender or recipient, use CDO or Redemption
and the PR_EMAIL (&H39FE001E) MAPI property to obtain the SMTP address from
the AddressEntry object. See
http://www.outlookcode.com/d/code/getsenderaddy.htm#redemption and
http://www.cdolive.com/cdo5.htm#EMailAddressOfSender for examples.


--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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