Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I access the Outlook 2003 address book on my form 3

Status
Not open for further replies.

sibasis

Technical User
Mar 1, 2002
94
Does anyone know of any dll's/ component I can use to access teh outlook address book, what I want to do is creat a form that has the TO, CC, BCC fields on it with an address book icon next to it, when the user clicks on the addressbook icon and selects an address it updates the textbox next to it with the address.

thanks.
 
How about the Microsoft Outlook Object Library...

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
ca8msm,

Can I import the complete address book doing this? I am already using this library to send mails and attachments, Could you show me how to view the complete address book using this.

thanks.
 
I'm sure you'll be able to get the information fairly easily by doing a bit of research. Start by looking here:


--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Heres a rough guide.
You will also need to add a reference to the Outlook namespace in your working project

Code:
Dim oApp As New Outlook.Application
Dim oNameSpace As Outlook.NameSpace
Dim oAddress As Outlook.AddressLists
Dim oAddressList As Outlook.AddressList

Public Sub zReadContacts

oNameSpace = oApp.GetNamespace("MAPI")

'Get The first Address List!
oAddress = oNameSpace.AddressLists
oAddressList = oAddress.Item(1)
dim iContacts As Integer = oAddressList.AddressEntries.Count()
dim sName1 as String = oAddresslist.AddressEntries.Item(1).Name

End Sub

Sweep
...if it works dont mess with it
 
Here is the complete code works like a charm, thanks krg hope this can solve your problem.

Reference - outlook obj library, redemption dll's

Dim m_redMapiUtils As Object
Dim redRecipients As Object
Dim names As String
Dim i As Integer
m_redMapiUtils = CreateObject("Redemption.MapiUtils")
redRecipients = m_redMapiUtils.AddressBook(, "Select Recipients", , False, 1, TypeofAddress)

If redRecipients Is Nothing Then
Exit Function
Else

For i = 1 To redRecipients.Count
If names = "" Then
names = names + redRecipients.Item(i).Name
Else
names = names + "; " + redRecipients.Item(i).Name
End If

Next

End If

m_redMapiUtils = Nothing
redRecipients = Nothing
Return names
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top