vcf files--getting the info for use by Access

R

richardconers

I have a set of .vcf files in a regular folder on my hard drive. I
want to read the information on the vcf file to put it into my Access
database (I have all of the commands I need in Access for processing
the information the way I want it and how to have Access get a hold of
the Outlook application).

Let's say the file's full name is "C:\Joe_Schnmoe.vcf"

I need to be able to "retrieve" the vcf file for processing. If I
manually open the vcf file it will be a ContactItem object and I know
how to use GetInspector to get the information I want. I don't know
how to use VBA to get the vcf file to the point where I can use
GetInspector to retrieve the information. [I see the fileSystemObject
code in VBA Help, but that code doesn't make it clear how to actually
read the information in the file either].

Any thoughts on how to do this, or is there a better way to "read" the
information in the file?
THANK YOU VERY MUCH!!!!!
 
S

Sue Mosher [MVP-Outlook]

Two choices:

1) Parse the text in the .vcf file according to the vCard specification (http://www.imc.org/pdi/)

2) Run the .vcf file, which will force Outlook to handle it as a contact Inspector window, from which you can return all the ContactItem fields. See http://www.outlookcode.com/codedetail.aspx?id=212 for sample code.

#2 is by far the easier.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

Ken Slovak - [MVP - Outlook]

VCF files are just text files. Unless something is registered to open a VCF
it will do so as a text file. Why not just read the text line by line and
parse it into contact properties? You can use FSO or any other method to
read the text file line by line or the complete file. If you do the complete
file as a string input parse it by using Split on vbCRLF.

Examine some VCF files to see what kind of properties are included in the
various text lines. You can also look up the VCF RFC to see a complete list
of all supported fields, not all of which are supported by Outlook natively.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top