# Import multiple .vCard files in Outlook



## matt.ledger

My uncle has about 100 .vCard files (each one a seperate contact) which he exported from outlook ... he now has a new computer and wants to import the contacts into outlook. I have tried importing them but am unable to select more than one at a time, I also tried dragging them into outlook but it just opened each one and again I had to saveeach one seperatly.
If anyone can help it would be great! My uncle is leaving tomorrow so not long!
Cheers, Matt


----------



## Anne Troy

Good luck, Matt. He should have just saved the pst file.
See:
http://www.officearticles.com/outlook/understanding_data_files_in_microsoft_outlook.htm


----------



## dw7017

With WinXP has a program in Accessories called Address Book.
If you open this then you can drag and drop a multiple entry vcard file, or multiple vcard files from explorer into it.
Then you can export to another format. To get the address book into Outlook 2003 contacts, I ended up export to a Comma Seperated Text file (.csv) and then importing this into Outlook.


----------



## Rollin_Again

This can also be done using a VBA macro. First create a folder on the root of the *C:* drive and name it VCARDS. Next copy all your individual vCard files (.vcf) to this newly created folder. Next open Outlook and click *ALT + F11* to open the VBA editor.

Click *TOOLS --> REFERENCES* and then select *Microsoft Scripting Runtime* and *Windows Script Host Object Model * from the list and place checks in the box next to each and click OK.

Next click *INSERT --> MODULE* and copy and paste the code below into the blank module. Save and run the macro to automatically import and save all the individual files into Outlook.



Code:


Sub OpenSaveVCard()
    
Dim objWSHShell As IWshRuntimeLibrary.IWshShell
Dim objOL As Outlook.Application
Dim colInsp As Outlook.Inspectors
Dim strVCName As String
Dim fso As Scripting.FileSystemObject
Dim fsDir As Scripting.Folder
Dim fsFile As Scripting.File
Dim vCounter As Integer
    
    
Set fso = New Scripting.FileSystemObject
Set fsDir = fso.GetFolder("C:\VCARDS")

For Each fsFile In fsDir.Files

    strVCName = "C:\VCARDS\" & fsFile.Name
    Set objOL = CreateObject("Outlook.Application")
    Set colInsp = objOL.Inspectors
        If colInsp.Count = 0 Then
        Set objWSHShell = CreateObject("WScript.Shell")
        objWSHShell.Run strVCName
        Set colInsp = objOL.Inspectors
    If Err = 0 Then
            Do Until colInsp.Count = 1
                DoEvents
            Loop
            colInsp.Item(1).CurrentItem.Save
            colInsp.Item(1).Close olDiscard
            Set colInsp = Nothing
            Set objOL = Nothing
            Set objWSHShell = Nothing
        End If
    End If

Next

End Sub

Regards,
Rollin


----------



## tarts

Rollin_Again said:


> This can also be done using a VBA macro ...


What to do if Outlook 2000 gives error 
"Run-time error '-2147023741 (80070483)': 
Automation error
No application is associated with the specified file for this operation"

and debugs line "objWSHShell.Run strVCName"


----------



## WebKing27

Hey Tarts, Welcome to the forum! 

Did you try the whole process as mentioned by Rollin?

Just check once again if something is missing or misspelled. ATB


----------



## tarts

WebKing said:


> Hey Tarts, Welcome to the forum!
> 
> Did you try the whole process as mentioned by Rollin?
> 
> Just check once again if something is missing or misspelled. ATB


Yes i did.

But vcard files I downloaded are with ".php" extensions instead of ".vcf". Maybe this causes that error? If it is so, maybe somebody can help how to change extensions (it is possible to rename one by one but I have over 300 cards :-( )


----------



## bp936

I found cardfile.exe on my backup drive, it's only 91KB but don't know how to attache it here, I can't see *.exe files uploading. It is not a zip file.
I always backed it up to my next computer since I found it easy to look for info on it and I have a lot of cards too. 
If someone can tell me how to send it, everyone could use it.


----------



## bp936

p.s. gotta bring my car into repair, will be back later to see if someone tells me how to send the cardfile.exe


----------



## Rollin_Again

Can you post one of your sample vCard files? Just change the extension to *.txt* before posting and I will manually change back to the original extension after downloading.

Regards,
Rollin


----------



## bp936

sorry I got dalayed
exe changed to txt 
I attached it as cardfile.txt but can't see it here if it really got attached, so I am just posting this now and see what happens.


----------



## bp936

yes, it worked, I saved to my desktop and changed extension back to exe and the little old program opend up as I remembered.
I hope this can help some of you. I use Firefox so I just doubleclicked on the attachement and it asked if I want to save or open it. First save it and rename it to cardfile.exe


----------



## gigigirrl

If I have a folder full of vcards I just select them, drag and drop into the open outlook with the contacts area open and into a white space in the contacts area- where the contacts are listed. I usually do about 20 at a time- it will open 20 windows in succession and I just say ok to each one. If i already have some info about that person it will ask me if I want to update. Simple, Fast, Free.


----------



## soulraven

hy, i have try this script but....i got a error.......









please help me.....

i have put the files in C:\VCARDS


----------



## Rollin_Again

When the error is thrown click the DEBUG button and then put your cursor over the variable *strVCName*. The value of the variable should pop up. What value is given?

Regards,
Rollin


----------



## soulraven




----------



## Rollin_Again

Since the filename contains spaces you may need to wrap it with double quotes. Try the following and let us know if it works.



Code:


objWSHShell.Run chr(34) & strVCName & chr(34)

Regards,
Rollin


----------



## soulraven

is working, but when i import the contacts with outlook, the contacts is duble, is any solution for this?i import with Motorola phone tools.....


----------



## Rollin_Again

So there are duplicate contacts shown in Outlook now? If so, once all the contacts are finished being imported by the macro just manually export them from Outlook to *.CSV* format. You can then delete the Contacts within Outlook and just manually import the newly created *.CSV* file. I believe Outlook should prompt you whether or not to import duplicates.

If that doesn't work for you then you can simply open the exported *.CSV* file in Excel and then delete the duplicate rows of data before re-saving the file and then importing back into Outlook.

Regards,
Rollin


----------



## jimr381

You do know that you can drag the vcards .vcf files from Windows explorer into the contacts folder and they will go in as contacts right?


----------



## Rollin_Again

jimr381 said:


> You do know that you can drag the vcards .vcf files from Windows explorer into the contacts folder and they will go in as contacts right?


In theory this should work but in the past I've had several machines that wouldn't cooperate and gave errors when I used this method. If I remember correctly the original vCards were created or exported in a program other than Outlook.

We'll have to wait to see what the OP says.

Regards,
Rollin


----------



## jimr381

They should in theory work if they have the .vcf extension. Vcards are great because they can be imported into Lotus Notes, Groupwise and Outlook.


----------



## rabble

This macro is great! thanks 

Is there a way to specify other than the default contacts folder for the files to import to?

I did copy all of my contacts out to a new folder before running this, so I was able to create a whole separate folder with the new contacts, but it would be nice if I could do it in the macro.


----------



## scifidavey

I was asking the same question and got nowhere with the first solution in the form of an .csv and I'm not going anywhere near the second. I tried this and it was *easily done*, just a bunch of single clicking, but fast none the less.

1.
Put all of the existing vCards you want to import into one folder. Half size that window to the left of the screen.

2.
Select the *Edit* menu followed by *Select All*

3.
Launch Outlook express and go to the mail window.

4.
Half size the window to the right so you can see the Folder with the Highlighted vCards behind it, that are dimly highlighted in grey due to that folder being in the background

5.
Drag the background grey highligted vCards onto the contacts folder you choose, I chose the one circled on my out look.

6.
Up pops all of those vCards and you just *Save and Close* them or close the window as you see fit.

7. Pretty Simple

When I tried to upload a picture I got an errors on page and I'm unable to insert the picture that makes this reference really easy to understand. Hope it works for you!!!


----------

