搜索全局地址列表
有没有办法只搜索 GAL 中联系人的给定姓名或姓氏或电子邮件地址?目前我有这些代码:
Private Sub QuickSearch() 'Working!
Dim oApp As New Outlook.Application
Dim eu As Outlook.ExchangeUser = oApp.GetNamespace("MAPI").AddressLists("Global Address List").AddressEntries("Justin Timberlake").GetExchangeUser()
If Not eu Is Nothing Then
response.write(eu.Name + ": " + eu.Alias + ", " + eu.FirstName + ", " + eu.LastName + ", " + eu.MobileTelephoneNumber + ", " + eu.Department + ", " + eu.PrimarySmtpAddress)
End If
oApp.Quit()
End Sub
嗯,这个代码的工作原理类似于通过 AddressList GAL 进行快速搜索。但出现的一个问题是,例如我有以下联系人姓名:
- Justin Bieber
- Justin Timberlake
我搜索了 Justin,仅 >贾斯汀·比伯将是结果,因为它是列表中第一个出现的人。
Is there a way to search for only givenName or LastName or emailaddress of a Contact in GAL?. Currently I have these code:
Private Sub QuickSearch() 'Working!
Dim oApp As New Outlook.Application
Dim eu As Outlook.ExchangeUser = oApp.GetNamespace("MAPI").AddressLists("Global Address List").AddressEntries("Justin Timberlake").GetExchangeUser()
If Not eu Is Nothing Then
response.write(eu.Name + ": " + eu.Alias + ", " + eu.FirstName + ", " + eu.LastName + ", " + eu.MobileTelephoneNumber + ", " + eu.Department + ", " + eu.PrimarySmtpAddress)
End If
oApp.Quit()
End Sub
Well, this one works like a Quick Search through the AddressList GAL. but one problem arises is that for example I have these contact names:
- Justin Bieber
- Justin Timberlake
And I searched for Justin, only Justin Bieber will be the result as it is the first one to be seen on the list.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在 AddressEntries 处停止,然后遍历列表
You need to stop at AddressEntries and then iterate through the list