Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

What's the best way to Import CSV data to Outlook Contacts weekly?

Posted on 2004-08-23
5
Medium Priority
?
317 Views
Last Modified: 2010-04-08
Hi Experts!

I have a client with a proprietary system for managing their business that also contains all their contact information.  They would like to have this information in a public folder of Outlook contacts also.

The proprietary system has some features that will let me export the data to a CSV file - name, address, phone number, etc.

I would like to automate the process of importing this data to Outlook.  I did a dry run with the Outlook import tool, and it's pretty close.  But I think to truly automate it (and remove office workers from the equation) I will need to use some script or some such.  

I programmed in the (distant...) past, and have read through posts suggesting that this can be done.  In my head, I imagine a solution where I write a VBS script to read the CVS file and use the Outlook model to write it out.  Is this the way to go?  If so, can someone give me a sample script I could modify to match the fields I have?

My CSV today has stuff like this...
First Name      Middle Name      Last Name      Suffix      Company Name      Phone Number      Fax Number      Mobile Phone      Business Street      Business Street 2      Business City      Business State      Business Postal Code      Email Address


Thanks for ideas and help!
0
Comment
Question by:localmagic
  • 2
  • 2
5 Comments
 
LVL 49

Accepted Solution

by:
sunray_2003 earned 2000 total points
ID: 11871601
Hi localmagic,

May be you are looking for this one

http:Q_20990824.html

All the best

SR..
0
 

Author Comment

by:localmagic
ID: 11872824
Thanks SR,

That does look most promising.  Can I use this code as subroutines in a "whatever.vbs" script running under WSH?  I have gotten  a bit confused lately -- some are designed to run as VBA/macro stuff under Outlook.  If that's true, then it looks like a little tweaking and some startup routines and I would be there.

LM
0
 
LVL 49

Expert Comment

by:sunray_2003
ID: 11872851
Not familiar with VBA code, Sorry ..

Try to use that code as it is and see if that would first solve your issue and then work on tweaking..

SR
0
 
LVL 18

Expert Comment

by:meintsi
ID: 11874806
As far as format required for input, export several contacts from Outlook into a .csv file and look at teh column headings.
0
 

Author Comment

by:localmagic
ID: 11897072
Thanks SR,

I finally decided that scripts weren't going to do it, so took a look at the other references and began coding a VB app.  In case it will help anyone else, here's the 'proof of concept' test I wrote.....

Dim strLine As String, strData() As String
Dim colItems As Items
Dim oOutlook As New Outlook.Application
Set colItems = oOutlook.GetNamespace("MAPI"). _
                        GetDefaultFolder(olFolderContacts).Items

'   Open the text file:
    Open "C:\Outlook.csv" For Input As #1

'   Discard the first line since that's the header info
    Line Input #1, stgrLine

'   Grab the data outta the file one line at a time until you hit the EOF mark:
    While Not EOF(1)

        '   Read a line
        Line Input #1, strLine

        '   Split the line into an array containing the data:
        strData = Split(strLine, ",")

        '   Write Contacts to Outlook
            With colItems.Add
                .FirstName = strData(0)
                .MiddleName = strData(1)
                .LastName = strData(2)
                .Save
             End With  

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
This article describes how to import Lotus Notes Contacts into Outlook 2016, 2013, 2010 and 2007 etc. with a few manual steps. You can easily export and migrate Lotus Notes contacts into Microsoft Outlook without having to use any third party tools.
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

916 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