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

Exporting e-mail addresses in a table to Outlook Express 1

Status
Not open for further replies.

InkyRich

Technical User
Aug 2, 2006
126
GB
Hello,
I have created a table of e-mail addresses in Access using a 'create table' query, which I need to automatically export to an Outlook Express address book using VBA. At the moment I am having to enter them manually from a print-out.
Can anyone advise how to do this?

Inky

A fool and his money are soon parted - so you might as well send it to me!
 
A few notes:

Code:
    Dim oApp As Outlook.Application
    Dim oContact As Outlook.ContactItem
    
    Set oApp = CreateObject("Outlook.Application")
    Set oContact = oApp.CreateItem(olContactItem)
    With oContact
        .FirstName = rs!FName
        .LastName = rs!SName
        .Email1Address = rs!Email
        .Save 
    End With
    Set oContact = Nothing
    Set oApp = Nothing
 
Thanks Remou I will give it a try
Inky

A fool and his money are soon parted - so you might as well send it to me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top