问题描述
我想通过MAPI从导入联系人Outllok。
标准的接触第一步是没有问题的:
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?
托比
更新:
感谢您与VCF档案的提示。 ?但我在哪里找到它们
Thanks for the hint with the vcf-Files. But where do I find them?
UPDATE2:
我打得四处OutlookSpy。我得到了与共享的联系人文件夹访问权限,但只能通过知道ID(这当然是不同的其他用户):
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) {
...
}
如何获得访问该文件夹不知道的ID?
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:
Recipient recip = Application.Session.CreateRecipient("Firstname Lastname");
MAPIFolder sharedContactFolder = Application.Session.GetSharedDefaultFolder(recip, OlDefaultFolders.olFolderContacts);
由于这并没有解决我的问题,我会问的!
Because this does not solve my problem I will ask another question!
这篇关于展望MAPI访问共享联系人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!