Click here to Skip to main content
15,881,812 members
Articles / Programming Languages / Visual Basic
Article

.NET class to create and maintain vCard information

Rate me:
Please Sign up or sign in to vote.
3.00/5 (21 votes)
8 Apr 2003CPOL 126.6K   1.1K   48   16
.NET class to create and maintain vCard information

Introduction

In a previous article, .NET class to create and maintain vCalendar information, I created a class to export calendar information to a vCalendar file. I have now also created an class to export contact information to a vCard file format. Again, I have tried to stick with the specs, but also tried to adapt the class to the way MS Outlook understands this format.

I am having some problems including the code directly in the article, so here is a brief overview of the vCard class.

Code

VB.NET
Public Class vCard
    Public Class vEmails
    End Class

    Public Class vEmail
    End Class

    Public Class vURLs
    End Class

    Public Class vURL
    End Class

    Public Class vTelephones
    End Class

    Public Class vTelephone
    End Class

    Public Class vAddresss
    End Class

    Public Class vAddress
    End Class

    Public Enum vLocations
        HOME
        WORK
        CELL
    End Enum

    Public Enum vAddressTypes
        PARCEL  'Parcel post'
        DOM     'Domestic'
        INT     'International'
    End Enum

    Public Enum vPhoneTypes
        VOICE
        FAX
        MSG
    End Enum
End Class

Also see my article .NET class to create and maintain vCalendar information

vCard specs

Here are some links to for the vCard specs (thanks Tommi):

License

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


Written By
Web Developer
United States United States
http://www.onlinescorekeeper.com/

Comments and Discussions

 
GeneralMy vote of 1 Pin
jgauffin1-Dec-10 1:25
jgauffin1-Dec-10 1:25 
GeneralMy vote of 1 Pin
Dave Kreskowiak24-Feb-10 5:45
mveDave Kreskowiak24-Feb-10 5:45 
GeneralAttachments Pin
Hrishit3-Aug-08 20:35
Hrishit3-Aug-08 20:35 
GeneralLink vCard is not a link Pin
Salam Y. ELIAS28-Nov-07 21:37
professionalSalam Y. ELIAS28-Nov-07 21:37 
GeneralProblem with adding to vEmails collection Pin
Erick Thompson29-Nov-04 20:00
Erick Thompson29-Nov-04 20:00 
GeneralRe: Problem with adding to vEmails collection Pin
slolife30-Nov-04 6:16
slolife30-Nov-04 6:16 
GeneralRe: Problem with adding to vEmails collection Pin
Erick Thompson30-Nov-04 7:32
Erick Thompson30-Nov-04 7:32 
The error is occuring on the line:

c.vEmails.Add(em)

And having spent a night getting some sleep, I see my problem now. I was referencing the type name, and not the member name. When I tried with

c.Emails.Add(em)

it works. It's amazing what a good night's sleep will do. Smile | :)

Thanks for the response!
Erick
GeneralRe: Problem with adding to vEmails collection Pin
slolife30-Nov-04 7:36
slolife30-Nov-04 7:36 
QuestionCan't read a vCard? Pin
Ashaman27-Oct-04 2:18
Ashaman27-Oct-04 2:18 
AnswerRe: Can't read a vCard? Pin
slolife27-Oct-04 5:48
slolife27-Oct-04 5:48 
GeneralSample of how to Use Pin
Anonymous9-Jul-04 5:42
Anonymous9-Jul-04 5:42 
QuestionError in code? Pin
adrianhesketh4-Jun-04 3:37
adrianhesketh4-Jun-04 3:37 
QuestionDrag/drop of a vCard? Pin
Steven Nies1-Dec-03 1:12
Steven Nies1-Dec-03 1:12 
Questionhow to use questions. Pin
seanerk24-Sep-03 5:41
seanerk24-Sep-03 5:41 
QuestionHow do i use it Pin
vbinfo14-Apr-03 21:00
vbinfo14-Apr-03 21:00 
AnswerRe: How do i use it Pin
Member 176368931-Mar-05 7:56
Member 176368931-Mar-05 7:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.