Вопрос

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.

Это было полезно?

Решение

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

Другие советы

For what it's worth - I just came across this thread looking for the same export to individual .VCF files from outlook. I haev 2007 (don't know if that makes a difference) but I selected all contacts and dragged them to a new email message to be added as individual .VCF files. After they were all added, I clicked in the attachments section of the new email, hit CTRL-A to highlight all of them, then left-click-dragged the first (and therefore all of them) to the folder I wanted the individual .VCF files in. A few minutes of Outlook "thinking" about my 400 contacts they were all there!

They sure make it hard to find, don't they? See if this helps. http://msdn.microsoft.com/en-us/library/aa579624(EXCHG.80).aspx

That includes: The following example uses the CDO Person object to obtain vCard information for a contact.

Dim oPerson As New CDO.Person
Dim strm As New ADODB.Stream

' Assume strURL is a valid URL to a person contact item
oPerson.DataSource.Open strURL

' You can set the ADO Stream object to the returned vCard stream
Set strm = oPerson.GetvCardStream

' Save the stream to a file.
' Note: using adSaveCreateOverwrite may cause an existing
' contact to be overwritten.
strm.SaveToFile "d:\vcard.txt", adSaveCreateOverwrite

' You don't have to set a Stream object,
' just use the Stream methods off GetvCardStream directly
oPerson.GetvCardStream.SaveToFile "d:\vcard.txt", adSaveCreateOverwrite

Yep, the only code sample there is in VB.

Just purchased the X8 and was about to get really really mad when I couldn't easily transfer my contacts...until I started snooping around on the phone.

First, export all your contacts in Outlook to vCards (I found emailing them to yourself is the easiest. If you get an error message "to many attachments..." you can save them from the email in your sent items folder) and copy the vCards to the memory card on your phone.

Second, open your address book on the phone then press the left button on the phone (the button with 4 little squares above it. NOT THE 4 BOXES ON THE SCREEN...THE PHYSICAL BUTTON!).

Third, select "Import/Export" and choose import from memory card. Import all vCard files and you should be golden.

Best of luck...don't ask me any questions because I will not be back to look at any more posts...just passing by trying to figure it out on my own.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top