Solved

Import large amount of vCards into outlook

Posted on 2006-10-24
7
1,209 Views
Last Modified: 2012-06-21
Hi Guys
I have about 900 vCards in a zip file. I can import them one-by-one but it will take ages to do. Does any of you know of a method which can import them all at once?

Thanks in advance
Christian Thomasberg
0
Comment
Question by:Scanbox
  • 4
  • 3
7 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 125 total points
ID: 17794428
Greetings, Christian.

The VBA script (i.e. Outlook macro) below will handle the import of all your vCard files.  Follow these instructions to use it.
1.  Start Outlook.
2.  Click Tools->Macro->Visual Basic Editor.
3.  If not already expanded, expand Modules and click on Module1.
4.  Copy the code below and paste it into the right-hand pane of the VB Editor.
5.  Edit the code as needed.  I placed comment lines where things need to change.
6.  Click the diskette icon on the toolbar to save the changes.
7.  Close the VB Editor.
8.  Click Tools->Macro->Security.
9.  Change the Security Level setting to Medium.
10.  Unzip 100 or so of your vCards into the folder you specified in code.
11.  Run the macro.  It should open each .vcf file onscreen, showing it as an Outlook contact.  Once it's opened all 100 of the .vcf files it will close and save them all.  You can try unzipping all 900 files at once if you want, but that might be too many windows for Outlook to handle.  I'd do 100 at a time.  I know you asked for a solution that would do them all at once, but this is better than doing them manually.  

Sub MassVCFImport()
    'Change the path on the following line to that of the folder holding your .vcf files.  The path must end with a \
    Const ROOT_PATH = "C:\eeTesting\"
    Dim objShell As Object, _
        strFilename As String, _
        intIndex As Integer, _
        objInspector As Outlook.Inspector
    Set objShell = CreateObject("Wscript.Shell")
    strFilename = Dir(ROOT_PATH & "*.vcf")
    Do While strFilename <> ""
        strFilename = ROOT_PATH & strFilename
        objShell.Run strFilename, 1, False
        strFilename = Dir()
    Loop
    For intIndex = Application.Inspectors.Count To 1 Step -1
        Set objInspector = Application.Inspectors.Item(intIndex)
        If objInspector.CurrentItem.Class = olContact Then
            objInspector.Close olSave
        End If
    Next
    Set objShell = Nothing
    Set objInspector = Nothing
End Sub

Cheers!
0
 

Author Comment

by:Scanbox
ID: 17795834
Hi there
Thanks for the fast answer :)
I get this error when I try to run the macro from Outlook:
->        objShell.Run strFilename, 1, False
Run-time error '-2147024894 (80070002)
Method 'Run' of object 'IWshShell3' failed

Do you have any suggestions, how to solve this problem?

Kind regards
Christian
0
 
LVL 76

Expert Comment

by:David Lee
ID: 17800087
Do the individual vCard files end with a .vcf extension?  If yes, please check and see if .vcf is associated with Outlook.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:Scanbox
ID: 17810574
hi again
I have checked that the above conditions is true, but I still get the error when trying to run the macro.
I am trying to import the vcards from citrix, so the folder path would be: M:\vcards - Do you think citrix is causing the problem?

Thanks for taking the tome to help me out, I really appreciate it

/Christian
0
 
LVL 76

Expert Comment

by:David Lee
ID: 17810633
> Do you think citrix is causing the problem?
It's possible.  Is there any way yo can try this outside of Citrix?  I wrote and tested this using Outlook 2003 running on Windows XP and it worked perfectly.
0
 

Author Comment

by:Scanbox
ID: 17818268
It worked :)
Thanks for your help
0
 
LVL 76

Expert Comment

by:David Lee
ID: 17819532
Cool.  You're welcome.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
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…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

823 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