tags:

views:

45

answers:

2

I am trying to create a .vcf file programmatically in C#, and writing a bunch of strings in the correct format in that file. But when i try to open it manually, the following message appears.
Could not start Microsoft Outlook.The file maynot exist, you may not have permission to open it, or it may be open in another program.

But when i create a text file manually write the same bunch of strings in the vcard format and change the extension to .vcf and then open the file, it opens properly with outlook

Any help!!!

+1  A: 

You don't say so explicitly, so I have to ask: have you elimated all of the suggestions Outlook gives you? The file isn't currently still open with a lock by your program? The file permissions are such that it can be read by the outlook user? The file does exist?

Randolpho
+1 most likely your program hasn't closed the file.
ChrisBD
A: 

Hi,

Verify you used CrLf for line terminiators in your code. If you use Environment.NewLine or just \n's, that may be the problem.

Cheers!

Dave

dave wanta