C# – Export all contacts as vcards from Outlook


So, I want to export all my contacts from Outlook as vcards. If I google that, I get a bunch of shareware programs, but I want something free that just works.

If I'm to code it myself, I guess I should use the Microsoft.Office.Interop.Outlook assembly. Has anyone already code to convert ContactItems to vcards?

Edit: I solved it in a completely different way, see answer below, but I have marked dok1.myopenid.com's answer as accepted because it answers my original question.

Best Solution

I solved it in a non-programmatically way:

  • Selected all contacts in Outlook
  • Forwarded them as cards to myself
  • Saved all the attachments (vcards) in a folder, c:\temp
  • Opened a command prompt and typed the command copy /a *.vcf c:\allcards.vcf which concatenates all vcards into one