Sunday, February 21, 2010

How to Import Multiple vCard Files in MS Outlook

Source of this post

You can import multiple vCard files, the ones with the extension .vcf, in the Microsoft Office Outlook using a VBA macro. Just follow the steps below:

  1. Create a folder on the root of the C: drive and name it VCARDS.
  2. Copy all your individual vCard files (.vcf) to this newly created folder.
  3. Open Outlook and click ALT + F11 to open the VBA editor.
  4. 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.
  5. Click INSERT --> MODULE and copy and paste the code below into the blank module and save it.

    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 Chr(34) & strVCName & Chr(34)
            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

  6. Finally, run the macro to automatically import and save all the individual files into Outlook.

But before running the macro just ensure the following:

  1. Whether Outlook is the default program to open *.vcf files. You can check this by right-clicking the file and choosing ‘Properties’. The Properties Dialog Box will open. Go to the General Tab and check whether Opens With has Microsoft Office Outlook written besides it. If it’s not so, then click on the Change button and select ‘Microsoft Office Outlook’ from the list of programs. In the ‘Properties Dialog Box’ click Apply and OK.
  2. Check Macro Security Settings in MS Outlook. Go to Tools->Macro->Security. Set it to ‘No Security Check for Macros’; run the macro and after finishing reset your previous Macro Setting.
  3. (For my use only) Delete all previously saved contacts in Outlook before running the macro.

And do the following after macro finishes the import:

  1. Change back the default program to open *.vcf files from Outlook to the previously set default program (in my case its Notepad++).
  2. Change back the Macro Security settings from ‘No Security Check for Macros’ to your previously set one (in my case "Warning for signed macros and disable all unsigned macros”).

P.S. It will take some time to complete the operation (mine took around 3 minutes for 670 vcf files), depending upon the no. of vCards you are importing, as it opens the individual files and saves it in Outlook.
Further, you cannot do anything else on your system in the meanwhile. It works fine in Microsoft Office Outlook 2003 and 2007; not sure about others.




Saturday, February 20, 2010

Invitation to Happy School Alumni Association Get-together Lunch on Sunday, 28 Feb 2010, at Kushmanda Farms

Dear ex-Happian Friends,

There is a get-together lunch organised by the Happy School Alumni Association on Sunday, 28 Feb 2010, 11 a.m., at Kushmanda Farms, NH-8, Delhi-Gurgaon Road. All the Alumni of Happy School along with their family (spouse, kids, fiancé / fiancée, boyfriend / girlfriend) are cordially invited.

The entry-cum-lunch fee is Rs. 500 per head. Secondly, those ex-Happians who are still not the members of the Alumni Association, can become the lifetime members of the Happy School Alumni Association by paying an additional sum of Rs. 500 (in respect of the ex-Happian only and not his family) there at the venue itself.

Please bring along 2-3 passport size photographs and a proof (any reasonable document) confirming that you are an ex-Happian for a hassle-free registration process.

Those registered members to whom Happy School Alumni Association's Membership I-Cards are not issued yet, are requested to bring their registration receipt along with them.

Becoming a member has the its own benefits
like getting to know about the other members, access to Happy School Alumni Association's Activities Calendar, accessibility to various activities organised by the Alumni Association along with other emotional opportunities like reconnecting with old friends and reliving some of the best memories of life at school.

Click here to see the invitation card and the (hand-made) venue map (to enlarge the photos, either download them or click on the magnifier button above the upper right corner of the picture area).

Kindly confirm your participation by Tuesday, 23 Feb 2010, either to me or the other members (for details of other members, please see the invitation card) in order to help us plan better. Please feel free to revert for any queries.


Further
, you are requested to spread this info to as many ex-Happians, including your seniors and juniors,  as possible because it is you all that will add fizz to the environment there.
More the attendance, better will be the experience!
Please ask them either to visit the link:
www.bit.ly/alumnimeet28feb
or send an email or call us (all the contact details are in the invitation card and the end of this post).


It will be great to have you all there...

Wishing You Happiness Always..

keep in touch...

Kapil Gupta

(Class of 2004) 
facebook, orkut