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
Solved

Import large amount of vCards into outlook

Posted on 2006-10-24
7
1,210 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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.
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
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…

840 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