Solved

Import large amount of vCards into outlook

Posted on 2006-10-24
7
1,212 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
[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
  • 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
SendBlaster Pro 4 - Bulk Email Sending Software

SendBlaster 4 Pro - Best Bulk Emailing Sending Software
Automatic Subscribe / Unsubscribe Processing
Great for Newsletters & Mass Mailings
Optional HTML & Text Composition
Integration with Google Features
Built in Spam Score Checking
Free Professional Templates - Feature Packed!

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
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…

752 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