Windows Address Book from VB6

Hi Experts.

I'm trying to access the Windows Address Book (WAB) from Visual Basic 6.0. I have found that MAPI contains some Methods for this, but Microsoft doesn't support them and that will overhead my application with MAPI files.

WAB32.DLL it's the file in Windows that contains the information for getting Contacts information from the Address Book, but I haven't found a VB6 example to use this DLL within VB.

I would apreciate if you can tell me how to get the Contacts information from WAB without using MAPI or other external DLL or file (only with WAB32 library) using Visual Basic 6.0.

Thank you in advance!

Regards,
Pablo Barvo
pablobAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SethiCommented:
Not possible in VB.
0
Mikal613Commented:
Youll have to do it manually

Youll probably have to register but

http://www.devcity.net/forums/topic.asp?tid=46944&highlight=read%7Cwab

Take a look at the bottom paragraph there is a VB project that uses an api to do the job.
The path of the Windows Address Book (wab) file used by Outlook Express can be found in the registry at: HKEY_CURRENT_USER\Software\Microsoft\WAB\WAB4\Wab File Name.

Here's what I've managed to figure out about the wab file format, looking at it with a hex editor (first byte of the file is byte zero).

Byte #:
32-35 ($20-$23) - Location (Address) in the file of the start of the table that tells where the information for each contact is located (I'll refer to it as the Contact Data Table).
36 ($24) - Number of entries in the Contact Data Table.
48-51 ($30-$33) - Location in the file of the list of Display Names for the persons (contacts) in the address book.
52 ($34) - Number of Display Names in the file
64-67 ($40-$43) - Location in the file of the list of Last Names for the contacts.
68 ($44) - Number of Last Names in the file.
80-83 ($50-$53) - Location in the file of the list of First Names for the contacts.
84 ($54) - Number of First Names in the file.
96-99 ($60-$63) - Location in the file of the list of E-Mail Addresses.
100 ($64) - Number of E-Mail Addresses in the file.

In you're trying to read the file in binary mode using VB, you'll need to add one each to each of the values above, since VB considers the first byte of a file to be byte one, not byte zero.

Format of the Contact Data Table (location as specified above):
Each entry in this table occupies 8 bytes. The first four bytes of each entry are what we'll call the Contact Index, a value that uniqely identifies each contact in the address book. The 5th through 8th bytes are the location (address) in the file where the Contact Data Record (Home Address, Home Phone, Work Phone, etc.) can be found. The exact format of the Contact Data Record is not something I've figured out yet.

Format of the other lists above (Display Name, Last Name, First Name, and E-Mail Address):
Each entry in one of these lists occupies 68 bytes. The bytes are stored as Unicode, meaning there are two bytes for each character, with the upper byte being zero (at least in English language versions of Windows). By reading every other byte, you can get the ASCII values that represent each character in an entry in the list. When you come to a byte pair where the lower order byte is zero, you've reached the end of the text for that entry. The 65th to 68th bytes of each entry are the Contact Index. By matching up Contact Index values between lists, you can tell which entry in one list goes with an entry in another (i.e., which Display Name belongs with which E-Mail Address). You can also match the Contact Index in these lists to the one in the Contact Data Table to determine where the rest of the contact's information is located in the file.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

pablobAuthor Commented:
Hi Experts,

I have test all the answers you have send, and no body have answered my question yet.... I'm planning to get a refund because the solution has not been posted.

Please post your comments....

Thank you
0
moduloCommented:
Closed, 500 points refunded.

modulo
Community Support Moderator
Experts Exchange
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ozgunyCommented:
Why isn't it possible to use WAB32 from Visual Basic?

Thanks.
0
CaverousCommented:
0
astrix2Commented:
Very nice the code in

http://www.locati.it/michele/kwab/

Have good source code for extrac simple the address book:

http://www.locati.it/michele/kwab/download/kwab1.2.zip

Thanks for the link!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.