Does any body know how to save your contacts in outlook to the harddrive. i no how to list them. but then i tried the save as methosd.
oContact.SaveAs("C:\contacts\" + list.selectedItem + ".vcf", null);
and that doesnt work. Any ideas?
my code...
Outlook._Application olApp = new Outlook.ApplicationClass();
Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");
Outlook.MAPIFolder oContacts = olNs.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
Outlook.Items oItems = oContacts.Items;
for (int i = 1; i <= oItems.Count; i++)
{
Outlook._ContactItem oContact = (Outlook._ContactItem)oItems.Item(i);
list.Items.Add(oContact.FullName);
oContact.SaveAs("C:\\apps\\" + list.SelectedItem,null);//error here
oContact = null;
}
EDIT:
here is the error
Can't write to file: C:\Apps\. Right-click the folder that contains the file you want to write to, and then click Properties on the shortcut menu to check your permissions for the folder.
yea i have permisstion i am admin and all....it gives that eroor no matter where i write