Click here to Skip to main content
Licence CPOL
First Posted 15 Jul 2010
Views 8,096
Bookmarked 10 times

How to import your exisiting contacts from your old Nokia phone to your new iPhone?

By | 15 Jul 2010 | Technical Blog
You may want to import your existing contacts from your old Nokia (or in general VCard format) to your new iPhone.You need to follow some simple steps...
A Technical Blog article. View original blog here.[^]

You may want to import your existing contacts from your old Nokia (or in general VCard format) to your new iPhone.

You need to follow some simple steps:

First you need to have Outlook and iTunes installed on your computer, then copy your .vcf files to a location in your hard disk, e.g. C:\VCARDS. Now when you open .vcf files, Outlook brings a window, then you can save and close the window, the contact file is imported to your Outlook's Contacts. You need to repeat this action for all of your .vcf files. (I'll explain a way for bulk importing contacts later in this article)
After that, you import all of your contacts to Outlook, you can simply synchronize iTunes contacts with Outlook and your iPhone. Done!

But there is still one issue remaining, importing all of your .vcf files manually is a very time consuming and boring job, let's write a code to do this automatically for you!
I've taken this code from here. Nice piece of code!

Here are the steps you need to do:

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.

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

Thanks Rollin for the code.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

mrt_doulaty



Iran (Islamic Republic Of) Iran (Islamic Republic Of)

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 15 Jul 2010
Article Copyright 2010 by mrt_doulaty
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid