View Single Post
  #9  
Old March 3rd 08, 07:39 AM posted to microsoft.public.outlook.program_vba
satishsuman
external usenet poster
 
Posts: 4
Default Contact Program




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..





"BrianL" wrote:

Thanks for all of your help here guys. The code that Eric gave me and the new
approach Sue contributed will help me greatly.

I would sit here and ask you to hold my hand through writing this code, but
where's the accomplishment in that? haha

Thanks again,

Brian L (the 16 year old programmer :-P )

"Sue Mosher [MVP-Outlook]" wrote:

Right, if you use those rule condition/exceptions, you won't have to do Step #2 at all.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



Ads