我试图获取Office365的联系人。但是两个联系人都列出了名称和联系人获得相同的结果。如何单独获取联系人列表名称和联系人。
我的代码:
Folder folder = Folder.bind(service, WellKnownFolderName.Contacts);
ItemView view = new ItemView(10);
FindItemsResults findResults = service.findItems(folder.getId(), view);
System.out.println(" Resulting Size : "+ findResults.getTotalCount());
for (Item item : findResults.getItems()) {
try {
System.out.println("id:" + item.getId());
System.out.println("sub==========" + item.getSubject());
} catch (Exception e) {
System.out.println("Exception while processing");
}
}
结果:
结果大小:12
ID:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwzAAA = sub ========== Prem联系人列表 ID:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwyAAA = sub ========== Ramesh敏捷列表 ID:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwxAAA = 子========== dshvbisdjkbv ID:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwwAAA = 子========== hjdfbvdfbdf ID:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwvAAA = 子========== jobing ID:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwuAAA = 子========== pisting ID:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwtAAA = 子非========== ID:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwsAAA = 子==========三茗 ID:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwrAAA = sub ========== Mani Rathnam ID:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwqAAA = 子========== ENC