如何使用C#从Outlook的联系人访问Business Street属性

问题描述:

我正在将Outlook联系人导出到.csv文件并将所有Outlook联系人带到



I am exporting Outlook contacts to .csv file and took all Outlook contacts to

List<Outlook.ContactItem> contactItems





创建了一个名为ConvertToCSV()的方法来提取特定联系人的每个属性。在此方法中,我将每个联系人的属性添加到List中如下所示。



created a method called ConvertToCSV() to extract each property of particular contact.In this Method am adding each contact's properties to List as shown below code.

private void ConvertToCSV(List<Outlook.ContactItem> contactItems)
    {      
        using (var file = File.CreateText(@"D:\ExportContacts1.CSV"))
        {
            file.WriteLine(ContactItemsListToCSV());
            foreach (var arr in contactItems)
            {
                List<string> list = new List<string>();
                list.Add(arr.Title);
                list.Add(arr.FirstName);
                list.Add(arr.MiddleName);
                list.Add(arr.LastName);
                list.Add(arr.BusinessAddress);
                list.Add(arr.BusinessAddressStreet);                   
                list.Add(arr.BusinessAddressCity);
                list.Add(arr.BusinessAddressState);
                list.Add(arr.BusinessAddressPostalCode);
                list.Add(arr.BusinessAddressCountry);
                //and other properties of Outlook ContactItem 
              file.WriteLine(list[0] + "," + list[1] + "," + list[2] + "," + list[3]);
              //adding other list items too        
  } 



当我看到outlook创建的.csv文件时,我可以找到


when i see the .csv file created by outlook,in that i could find

<pre lang="xml">Business street, Business Street 2,Business Street 3
</pre>





这个商业街我需要在上面的代码中绑定哪个属性。在Outlook联系人中,我看到过像树状结构一样





for this Business Street which property i need to bind in the above code.In outlook contacts, i had seen like tree structure as

Business Address
          Business Street
          Business Street 2
          Business Street 3
          ...and so on



附加图像。如何从Outlook.Application访问这些属性,以便我可以获得与Outlook生成相同的.csv文件..任何建议请


attaching the image too.How can i access these properties from Outlook.Application so that i can get the same .csv file as the Outlook generates..any suggestion please