B
bgcpen
Hello,
I'm trying to find the full name of a person from the alias (CdoPR_ACCOUNT)
in a Global address book. Here is the code i found and adjusted from some
other posts on this board.
Function Item_Open()
Dim myAlias
Dim oSession
Dim myGAddressList
Dim myGEntries
Dim myGEntry
Dim Name
Const CdoPR_ACCOUNT = "AB50C"
myAlias = CdoPR_ACCOUNT
Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", False, False
Set myGAddressList = oSession.AddressLists("Global Address List")
Set myGEntries = myGAddressList.AddressEntries
Set myGEntry = myGEntries(myAlias)
Name = myGEntry.Fields(CdoPR_DISPLAY_NAME).Value
oSession.Logoff
Set oSession = Nothing
Set myGAddressList = Nothing
Set myGEntries = Nothing
Set myGEntry = Nothing
End Function
The problem is that the GAL search searches by myAlias (ex. AB50C) and
doesn't not find any entry by that name. So the proper address entry is not
found and it cannot return the full name because it can't find the entry. Is
there any way to search the GAL by the CdoPR_ACCOUNT field?
I'm trying to find the full name of a person from the alias (CdoPR_ACCOUNT)
in a Global address book. Here is the code i found and adjusted from some
other posts on this board.
Function Item_Open()
Dim myAlias
Dim oSession
Dim myGAddressList
Dim myGEntries
Dim myGEntry
Dim Name
Const CdoPR_ACCOUNT = "AB50C"
myAlias = CdoPR_ACCOUNT
Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", False, False
Set myGAddressList = oSession.AddressLists("Global Address List")
Set myGEntries = myGAddressList.AddressEntries
Set myGEntry = myGEntries(myAlias)
Name = myGEntry.Fields(CdoPR_DISPLAY_NAME).Value
oSession.Logoff
Set oSession = Nothing
Set myGAddressList = Nothing
Set myGEntries = Nothing
Set myGEntry = Nothing
End Function
The problem is that the GAL search searches by myAlias (ex. AB50C) and
doesn't not find any entry by that name. So the proper address entry is not
found and it cannot return the full name because it can't find the entry. Is
there any way to search the GAL by the CdoPR_ACCOUNT field?