I want to import contacts from Outllok via Mapi. First step with standard contact is no problem:
MAPIFolder contactObjects =
outlookObj.Session.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
foreach (ContactItem contactObject in contactObjects.Items) {
... import contact ...
}
In a second step I additionally want to import shared contacts. Only thing I found was using
OpenSharedItem(sharedContacts.vcf)
but I don't know the name of the file (shared item) I want to open. Does someone know how to access shared contacts and can help me out?
Tobi
Update:
Thanks for the hint with the vcf-Files. But where do I find them?
Update2:
I played around with OutlookSpy. I got access to the folder with shared contacts, but only by knowing the id (which is of course different for other users):
var ns = outlookObj.GetNamespace("MAPI");
var flr = ns.GetFolderFromID("00000000176A90DED92CE6439C1CB89AFE3668F90100D1AD8F66B576B54FB731302D9BB9F6C40007E4BAC5020000");
foreach (var contactObject in flr.Items) {
...
}
How do I get access to the folder without knowing the id?
Well the solution to the question as it is asked in the title is almost simple. You just need to call:
Because this does not solve my problem I will ask another question!
I have done some programming to get contact from outlook. I am giving you some example code to help you up with this ..It is not excatly want you want but i think this will help you with your problem...
You will need to either explicitly parse the vCard files or you can use Redemption - it allows to import vCard files using RDOContactItem.Import - http://www.dimastr.com/redemption/RDOMail.htm#methods