我目前正在尝试开发一个 outlook 插件。为了实现非功能性需求,我需要访问存储在 .nk2 文件中的 outlook 缓存联系人。我引用了这个 post但不知道该怎么做。
已编辑(答案):
Microsoft.Office.Interop.Outlook.Application oApp = Globals.ThisAddIn.Application;
Microsoft.Office.Interop.Outlook.MAPIFolder inboxFolder = oApp.GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderInbox);
StorageItem storage = inboxFolder.GetStorage("IPM.Configuration.Autocomplete", OlStorageIdentifierType.olIdentifyByMessageClass);
//IPM.Configuration.Autocomplete
PropertyAccessor propertyAcc = storage.PropertyAccessor;
byte[] got = propertyAcc.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x7C090102");
目前我被困在访问字节数组中,当我访问数组时,值与此 post 中提到的不同
最佳答案
Microsoft.Office.Interop.Outlook.Application oApp = Globals.ThisAddIn.Application;
Microsoft.Office.Interop.Outlook.MAPIFolder inboxFolder = oApp.GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderInbox);
StorageItem storage = inboxFolder.GetStorage("IPM.Configuration.Autocomplete", OlStorageIdentifierType.olIdentifyByMessageClass);
PropertyAccessor propertyAcc = storage.PropertyAccessor;
byte[] got = propertyAcc.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x7C090102");
使用描述here访问 byte[]
中的字段。我完成了它正常工作的代码。您只需要遍历每个字节并在访问时检查数据类型。
关于c# - Outlook 2010 自动完成流(缓存联系人),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11770955/