Solved

Import large amount of vCards into outlook

Posted on 2006-10-24
7
1,211 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
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 …
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…

740 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