Solved

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

Posted on 2004-08-23
5
310 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 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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…
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…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now