?
Solved

MAPI  Address  Book

Posted on 2003-03-18
6
Medium Priority
?
269 Views
Last Modified: 2010-05-03
Hello
How can i list my address book from outlook in a listbox in vb6.i can see it with mapimessage.show but i want to list it in listbox
thanks
0
Comment
Question by:maryam1359
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Accepted Solution

by:
hmadhur earned 100 total points
ID: 8157889
Hi,
Have you tried automating outlook from VB? This, I would say, is the best option. As you have outlook installed on the machine, you can automate outlook and access all the information you want.

Here is a sample code that adds the first names of all the people in my outlook contacts.

    Dim objOutlook As New Outlook.Application
    Dim objFolder As Outlook.MAPIFolder
    Dim objItem As Outlook.ContactItem
    Dim objNameSpace As Outlook.NameSpace
    Dim i As Integer
   
    Set objNameSpace = objOutlook.GetNamespace("MAPI")
    Set objFolder = objNameSpace.GetDefaultFolder _(olFolderContacts)
   
    For i = 1 To objFolder.Items.Count
        List1.AddItem objFolder.Items(i).FirstName
    Next
   
    objOutlook.Quit

It is that simple. You can list any of the properties instead of first name. This is the easiest way.

Hope it helps.

Regards
Madhur
0
 
LVL 1

Expert Comment

by:hmadhur
ID: 8157900
Set objFolder = objNameSpace.GetDefaultFolder _(olFolderContacts)

Dont put the underscore before the brackets. It was a typing mistake  :~)

Madhur
0
 
LVL 2

Assisted Solution

by:DanAvni
DanAvni earned 100 total points
ID: 8158330
Note that outlook has a security warning displayed when you try to access contact information (this applies to all versions of outlook since outlook 2000 with some SP and above). to overcome this you need to access the contacts through extended MAPI which is only available in C++.

we have studied this very hard and deep and found that you can use outlook redemption (http://www.dimastr.com/redemption/) as a good MAPI object that will override the security warning
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:CleanupPing
ID: 8532106
Hi maryam1359,
This old question (QID 20554439) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 8982890
This question has been classified as abandoned.  I will make a recommendation to the moderators on its resolution in a week or two.  I would appreciate any comments by the experts that would help me in making a recommendation.
It is assumed that any participant not responding to this request is no longer interested in its final deposition.

If the asker does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp

GPrentice00
Cleanup Volunteer
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9033977
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Split between hmadhur and DanAvni

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question