• Outlook User
  • New Outlook app
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
  • Developer
  • Microsoft 365 Admin
    • Common Problems
    • Microsoft 365
    • Outlook BCM
    • Utilities & Addins

Macro to Bulk Import Contacts and vCards into Outlook

Slipstick Systems

› Developer › Macro to Bulk Import Contacts and vCards into Outlook

Last reviewed on September 30, 2015     60 Comments

Microsoft Outlook does not support importing multiple vCards - you need to import them one vcard at a time. While this is tolerable for a few, its frustrating when you a large number to import.

The macro at Move Messages from File System into Outlook Folders bulk imports messages, appointments (msg or ics), or vcards (msg or vcf).

This can also be done using VBA, basically automating the process you'd use to do it manually: open each contact, save in your default Contacts folder then close it. Unless you are Superman, the macro will finish long before you would.

Macro to bulk import vcards

Begin by creating a folder named vcards on root of the c:\ drive. The path will be c:\vcards. Copy all your individual vCard files (.vcf) to this folder. (You can use a different folder but will need to update the macro with the correct folder path.)

Next open Outlook and press ALT + F11 to open the VBA editor.

Go to Tools, References and 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.

Click Insert, Module and copy and paste the following code into the blank module. Save and run the macro to automatically import and save all the individual files into Outlook.

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

'original code
'strVCName = "C:\vcards\" & fsFile.Name

'Zeda's fix for spaces in filenames
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

Import Contacts Saved as MSG Files

The macro above works with vCard files and replicates the action of opening the vCard and clicking Save, which saves it to the Contacts folder. It won''t work with Contacts saved as .msg files, which are saved to Contacts using the Copy to My Contacts command.
copy to contacts command

By changing Save in colInsp.Item(1).CurrentItem.Save to Copy or Move, we can import Contacts saved as .msg files.

However, in my tests, Copy created duplicates, while Move created just one contact.

At the top of the macro, under the Dim statements, add these two lines. This tells Outlook where you want to it put the contacts.

Dim olFolder As Outlook.Folder
Set olFolder = Session.GetDefaultFolder(olFolderContacts)

Change the line that saves the message to Move:

colInsp.Item(1).CurrentItem.Move olFolder

Now when you run the macro on a folder containing contacts saved as .msg files, it will place a copy in your default Contacts folder.

More Information

How to use Outlook's VBA Editor

The tools listed at Import vCards in Bulk in Microsoft Outlook will import or export vcards in bulk.

Macro to Bulk Import Contacts and vCards into Outlook was last modified: September 30th, 2015 by Diane Poremsky

Related Posts:

  • Import vCards into Outlook
  • Transfer Outlook Contacts to Kindle Fire and Android tablets
  • Import Messages from File System into Outlook Folders
  • Moving from Outlook Express to Outlook

About Diane Poremsky

A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Subscribe
Notify of
60 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Erik (@guest_217396)
January 3, 2021 5:22 am
#217396

Hi and thx for your code.
I am looking for going the other way, i.e. transfer contacts from Outlook to Thunderbird. Outlook exported all contacts in msg-format, that I would need to convert to vcf-format, and then import to Thunderbird.
Is there some VBA-code I could use from within Excel to realise this?

0
0
Reply
Basilio (@guest_217212)
November 21, 2020 5:28 pm
#217212

You saved my life!

actually I prefer thunderbird which is free and handles contacts better and so on. But I have a 70-year-old client who doesn't get used to new programs other than commercial ones. Osea perspective.

almost 600 contacts imported into Outlook 365 with your script. Hugely grateful

PS: Thundebird if it pulls multiple contacts from a vcf file

Basil
from Peru

0
0
Reply
Emanuel Garcia (@guest_210566)
March 9, 2018 3:48 pm
#210566

Hello!

Thanks for the tutorial!

You have a script to import EML files to outlook???, i have a lot of then...

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Emanuel Garcia
March 9, 2018 4:57 pm
#210567

Not offhand, but will look at writing one.

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Diane Poremsky
March 9, 2018 5:01 pm
#210568

It should be easy to do now that I think about it - open the file, copy to folder.

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Emanuel Garcia
March 9, 2018 5:24 pm
#210569

In looking at this macro and the one at https://www.slipstick.com/developer/code-samples/move-messages-file-system-outlook/ - they should work. I don't have any eml's handy right now to test it... will try to test it later.

1
0
Reply
Francisco (@guest_206600)
May 18, 2017 10:15 am
#206600

Thanks a lot for this! I used it to import 1900 vcards to Outlook so this really helped a lot.

0
0
Reply
Kirt P (@guest_204860)
February 24, 2017 5:04 pm
#204860

Super great script. I'm a super PC user since 1985. Never programmed beyond AutoCAD's AutoLISP or Basic. This was cinch. Your step by step instructions were perfect. THANK YOU for saving me hours importing 229 VCF files into Outlook 2016.

0
0
Reply
Buzz (@guest_204074)
January 24, 2017 9:12 am
#204074

I get an execution error '440' impossible to move the elements (traduction from french) with the line : colInsp.Item(1).CurrentItem.Move olFolder.
The contact is added but duplicated and the macro stops.
Thanks

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Buzz
January 24, 2017 10:54 am
#204076

what are you using for
Set olFolder = Session.GetDefaultFolder(olFolderContacts) ? (This is the default contacts folder and isn't necessary unless you are using a different folder)

0
0
Reply
Emil (@guest_203122)
November 26, 2016 6:52 am
#203122

That was PERFECT!! I am not VBA literat at al, but thanks to this code all my contacts from 200 vcf cards are propelly imported with just few clicks!!!

0
0
Reply
federico (@guest_201429)
September 8, 2016 12:06 pm
#201429

This is GREAT and useful.
Here's what I did:
1) I used gmail to compile & edit a mix of my outlook and android contacts (phone numbers, email and postal addresses, notes, etc.)
2) I exported to my pc the entire list in a single vcard file, to be uploaded to my pc and android device;
3) it worked with android, but outlook was only able to load the first of the many contacts embedded in the single file;
4) I found on the internet and used this portable and free GUI utility to split the single multi-contact vcard file into many single-contact vcard files: VCARD SPLITTER (available at https://vcardsplitter.codeplex.com)
5) I followed the procedure described in this page to load hundreds of vcard files. It worked flawlessly and imported all contacts in seconds.
THANKS!!

0
-2
Reply

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 30 Issue 19

Subscribe to Exchange Messaging Outlook






Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • Week Month All
  • Jetpack plugin with Stats module needs to be enabled.
  • Open Outlook Templates using PowerShell
  • Count and List Folders in Classic Outlook
  • Google Workspace and Outlook with POP Mail
  • Import EML Files into New Outlook
  • Opening PST files in New Outlook
  • New Outlook: Show To, CC, BCC in Replies
  • Insert Word Document into Email using VBA
  • Delete Empty Folders using PowerShell
  • Warn Before Deleting a Contact
  • Classic Outlook is NOT Going Away in 2026
Ajax spinner

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in classic Outlook (Windows).

For new Outlook for Windows: Fixes or workarounds for recent issues in new Outlook for Windows .

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Outlook.com Recent issues: Fixes or workarounds for recent issues on Outlook.com

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Outlook (new) Feedback. Use this for feedback and suggestions for Outlook (new).

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




New Outlook Articles

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Google Workspace and Outlook with POP Mail

Import EML Files into New Outlook

Opening PST files in New Outlook

New Outlook: Show To, CC, BCC in Replies

Insert Word Document into Email using VBA

Delete Empty Folders using PowerShell

Warn Before Deleting a Contact

Classic Outlook is NOT Going Away in 2026

Newest Code Samples

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Insert Word Document into Email using VBA

Warn Before Deleting a Contact

Use PowerShell to Delete Attachments

Remove RE:, FWD:, and Other Prefixes from Subject Line

Change the Mailing Address Using PowerShell

Categorize @Mentioned Messages

Send an Email When You Open Outlook

Delete Old Calendar Events using VBA

VBA Basics

How to use the VBA Editor

Work with open item or selected item

Working with All Items in a Folder or Selected Items

VBA and non-default Outlook Folders

Backup and save your Outlook VBA macros

Get text using Left, Right, Mid, Len, InStr

Using Arrays in Outlook macros

Use RegEx to extract message text

Paste clipboard contents

Windows Folder Picker

Custom Forms

Designing Microsoft Outlook Forms

Set a custom form as default

Developer Resources

Developer Resources

Developer Tools

VBOffice.net samples

SlovakTech.com

Outlook MVP David Lee

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Diane Poremsky [Outlook MVP]

Make a donation

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Submit Outlook Feature Requests

Slipstick Support Services

Buy Microsoft 365 Office Software and Services

Visit Slipstick Forums.

What's New at Slipstick.com

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2025 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment