在VBA中获取Outlook的自动完成地址列表 [英] Get autocomplete address list of Outlook in VBA

查看:71
本文介绍了在VBA中获取Outlook的自动完成地址列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的所有自动完成的地址"添加到新的联系人文件夹中,但是我无法获得这些地址.我所说的自动完成的地址"是当您向他人发送电子邮件并在新电子邮件的收件人"字段中再次键入时保存的地址.

I am trying to add all my "autocompleted addresses" to a new contact folder but I can't get those addresses. What I call "autocompleted addresses" are the addresses saved when you send an email to somebody and you type it again in the "To" field of a new email.

我知道我可以通过使用

Set objOutlook = CreateObject("Outlook.Application")
Set myNameSpace = objOutlook.GetNamespace("MAPI")    
Set GAL = myNameSpace.AddressLists("Offline Global Address List")

但是我如何获得自动填写的地址?

But how can I get my autocompleted addresses ?

我正在使用Outlook 2010,并且我的帐户是Exchange帐户.

I am using Outlook 2010 and my account is an Exchange Account.

感谢您的帮助和时间.

编辑

我的完整代码:

Set objOutlook = CreateObject("Outlook.Application")
Set myNameSpace = objOutlook.GetNamespace("MAPI")
Set folder = myNameSpace.GetDefaultFolder(OlDefaultFolders.olFolderInbox)
Set storage = folder.GetStorage("IPM.Configuration.Autocomplete", OlStorageIdentifierType.olIdentifyByMessageClass)
Set propacc = storage.PropertyAccessor
Set got = propacc.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x7C090102")

问题:got为空...

Problem : got is empty...

推荐答案

自动完成(昵称)流存储在收件箱文件夹中的消息类为"IPM.Configuration.Autocomplete"的隐藏(关联)消息中.在 https://msdn.microsoft.com/zh-我们/library/office/ff625288.aspx .您可以使用MAPIFolder.GetStorage访问该消息.

Autocomplete (nickname) stream is stored in a hidden (associated) message with the message class of "IPM.Configuration.Autocomplete" in the Inbox folder. Its format is documented at https://msdn.microsoft.com/en-us/library/office/ff625288.aspx. You can access that message using MAPIFolder.GetStorage.

如果使用兑换是一种选择,则它将通过 RDOStore 公开昵称/ RDOSession .昵称集合.

If using Redemption is an option, it exposes nicknames through the RDOStore / RDOSession.Nicknames collection.

还要注意,对于Outlook VBA,确实需要创建 Outlook.Application 对象的实例,您已经具有指向该对象的固有Application变量.

Also note that in case of Outlook VBA you do need to create an instance of the Outlook.Application object, you already have an intrinsic Application variable pointing to that object.

这篇关于在VBA中获取Outlook的自动完成地址列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆