Solved

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

Posted on 2004-08-23
5
314 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 49

Accepted Solution

by:
sunray_2003 earned 500 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

627 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