View Single Post
  #10  
Old March 3rd 08, 02:48 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Contact Program

No, there aren't any built-in methods for importing (or exporting) to a CSV
file, you have to write your own code for that.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"satishsuman" wrote in message
...



Hi,
I need to fetch my outlook contacts in a csv file using c#.

I am able to do it by writing all the fields one by one in my data.csv.
e.g.


for (int i = 1; i = contactFld.Items.Count ; i++)
{
Outlook.ContactItem contact =
(Outlook.ContactItem)contactFld.ItemsIdea;


if (contact.Email1Address != null || contact.Email2Address
!= null || contact.Email3Address != null)
{
try
{
sw.Write(contact.FirstName);
sw.Write("',");
sw.Write(contact.LastName);
sw.Write("',");
sw.WriteLine(contact.Email1Address);

}
catch (Exception e1)
{
MessageBox.Show("Error");
}
}
}

Now, instead of creating this .csv file, I want to fetch the .csv file
diretly.

Is there any method to fetch it directly from MAPIFolder element?
Or any other way..


Ads