c# - Outlook 2010 自动完成流(缓存联系人)

标签 c# autocomplete outlook

我目前正在尝试开发一个 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/

相关文章:

c# - 使用基类和附加字段从 TypeBuilder 创建动态类型会生成异常

c# - PInvoke 找到一些函数,但找不到其他函数

javascript - 自动完成远程源多个输入

jQuery autocomplete _renderItem 问题,多个输入触发自动完成

css - 响应电子邮件

vba - 通过代码在 Outlook 中发送/接收

c# - Asp.Net Core API 注入(inject)单例依赖

javascript - Bootstrap typeahead 中的多项选择

c# - 使用 EWS 和 Exchange 2007 通过 session 实现 Outlook 2010 的组

c# - 后台 worker ReportProgress 方法