Import VCF files to an Outlook folder

  • Thread starter Thread starter MA
  • Start date Start date
M

MA

I need to import VCF files to an Outlook folder.

One option is to create the Outlook contact item and set all the
properties based on the VCF item which require parsing the VCF file,
etc.

Just wondering is there any easy way to import the VCF file to
Outlook.

BTW, I am using the Redemption library. I have used the Redemption
RDOMail.Import() to import external file to the message. It was great
the Import method takes care everything, hoping any other simple way
to import VCF files :).

Thanks in advance for your advice.

Regards,
MA
 
You can import them indirectly. What you basically need to do is automate
opening the .vcf files and then grab the Contact object from the opened
Inspector object via ActiveInspector.CurrentItem. To open the files, loop
through the .vcf files in the folder using the FileSystemObject from the
Microsoft Scripting Runtime Library to get the file names. Then use the
following Win32 API declarations to facilitate the call to opening the files:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Public Const conSwNormal = 1

You'll have to paste that into a standard Module, not the ThisOutlookSession
module. Then you can open the file with this call:

ShellExecute 0, "open", "D:\Users\Eric.GOOMBAHNET\Desktop\Eric Legault.vcf",
vbNullString, "", conSwNormal
 
Thanks Eric for your suggestions.

I guess your approach will open the VCF file in a window and then
save. I need to import many VCF files (could be thousands) to Outlook
which is part of the conversion utilities. I will prefer not to keep
opening window and close it.

Is it possible to automate the process of importing VCF files without
opening another window?

Thanks,
MA
 
Another way is to parse the contents of each .vcf file and manually create
the Contacts from scratch in code. Of course, you'd require a firm knowledge
of the vCard specification in order to parse the name-value pairs in the file.

vCard - Wikipedia, the free encyclopedia:
http://en.wikipedia.org/wiki/VCard

vCard 2.1 specification:
http://www.imc.org/pdi/vcard-21.txt

If you want to buy a solution to do this for you, there are several out
there - search for "import vcard Outlook" and you'll see several.
 
Back
Top