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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

import/export Outlook 2000 Address book with VB6

Status
Not open for further replies.

burritoranch

Technical User
Jun 26, 2002
6
0
0
US
Hey all,

Thanks to many of the other threads I have been able to export email addresses from outlook 2000 using Outlook 9.0 library and am also able to then import them back into another outlook 2000 on another computer. I do that this way because we dont run exchange server here. These are some problems I dont know how to tackle:

1. Can you check to see if contact already exists or overwrite contact with same name? Mine just keep adding same entry over and over.

2. How can you handle contact groups and the email lists they hold to export their information?

Any help would be appriciated. I am new to this place and love it. I hope I can help you guys out as much as you can help me. Thanks

Eric

 
Hey there

Do you know any Visual Basic ? If so, you can use VB to import and export from Outlook 2000 and build your own checks for overwriting, groups, etc. If you want a code example, let me know.

Hope it helps !!!
 
Hey,

Yeah I do know visual basic. I have already written some code to import and export but I just dont know the functions to overwrite or copy over groups. So if you can help me out with that it would be great. I have used Outlook.Application already so if you know how to extend my knowledge on this it would be great. Thanks.

Eric
 
It depends on whether the e-mail addresses are in contact items or a personal address book. Here's an example to check if an e-mail address exists in contacts. It's from a class module so references to the application and namespace objects have already been obtained. It also uses late binding so will work with different versions of Outlook. strEmail is a passed in parameter:
Code:
Dim objFolder As Object     'Default contacts folder
Dim objOLContact As Object  'Contact item
Dim strCond As String       'Filter string
        
'Get the Outlook Contact Item
Set objFolder = objOLNS.GetDefaultFolder(olFolderContacts)
On Error Resume Next
strCond = "[E-mail] = """ & strEmail & """"
Set objOLContact = objFolder.Items.Find(strCond)
On Error GoTo 0
If objOLContact Is Nothing Then
 'No existing contact with this e-mail address
End If
Paul Bent
Northwind IT Systems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top