Any way to convert Access database file to Oulook Address Book?

A

anonymous

I know this is a long shot, but my original mail
list/address book was built on MS Access. Any way to
convert it over to MS Outlook Express Version 6? Or am I
gonna have to manually input it into Outlook?
 
C

Cheryl Fischer

Outlook Express does not expose its objects/methods, etc., to other
programs, so it is not possible to use Access to add these addresses to the
OE address book. If you are using Outlook, it is possible and here is some
code taken from a KB article

First, set a reference to the Microsoft Outlook xx.x Object Library, where
xx.x is the version that you are using. Then, put the following code behind
a command button on a form:

Dim oOutlook As New Outlook.Application
Dim colItems As Items
Dim rsCont As Recordset
Dim strSQL As String
Dim strMsg As String

strSQL = "Select ContactName, EmailAddr from tblContacts " _
& "WHERE ContactName is not null and EmailAddr is not null;"

Set rsCont = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)

'Get a reference to the Items collection of the contacts folder.
Set colItems = oOutlook.GetNamespace("MAPI"). _
GetDefaultFolder(olFolderContacts).Items

Do Until rsCont.EOF
If Not blnIsContact(rsCont!ContactName, colItems) Then
With colItems.Add
.FullName = rsCont!ContactName
.Email1Address = rsCont!emailaddr
.Save
End With
End If
rsCont.MoveNext
Loop
rsCont.Close

MsgBox "Done!"

End Sub
END OF CODE TO BE COPIED TO COMMAND BUTTON

PASTE THE FOLLOWING CODE INTO ONE OF YOUR PUBLIC MODULES
Public Function blnIsContact(strName As String, colItems As Items) As
Boolean

Dim varItem As Variant
Dim strMsg As String

'Search for the FullName (strName) in Contacts. If it is found,
'notify the user.
Set varItem = colItems.Find("[FullName] = """ & strName & """")
If varItem Is Nothing Then
blnIsContact = False
Else
strMsg = "The contact named " & strName & " already exists. " _
& Chr(13) & Chr(10) & "Do you want to add this contact
anyway?"

If MsgBox(strMsg, vbYesNo) = vbYes Then
blnIsContact = False
Else
blnIsContact = True
End If
End If

End Function

END OF CODE TO BE COPIED TO PUBLIC MODULE.

hth,
 
I

Immanuel Sibero

Hi

OE does import a text file. You might create a couple of contacts in OE and
export them out to a text file (i.e. csv format). Examine the format of the
text file and create a text file from your original Access maillist/address
book following that text file format. OE will then import the it. You will
have to be the judge of whether all the efforts above are worth doing.

HTH
Immanuel Sibero
 

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