Hi,
I know the smtp-adresses of several persons and need to get the
information stored in other AdressEntry.fields. At the moment I do it
the following way:
smtpaddr = "a...@def.com" 'e.g. for this addess...
Set oAddressList = oSession.AddressLists("Global Address List")
Set oRecipients = ns.CreateRecipient(smtpaddr)
oRecipients.Resolve
Set objAddrEntry oAddressList.AddressEntries(oRecipients.NAME)
'This is the point: Here indexing by .NAME, won't work when more
receipients with the same name exist
postalcode = objAddrEntry.Fields(CdoPR_POSTAL_CODE) 'e.g. get
the Postal_Code
How can I address the addressEntry by an other information than by
name? This doesn't work correctly if more than on receipient with this
name exists.
Thx!
marco
Dmitry Streblechenko - 31 May 2005 18:08 GMT
Why do you even need to access AddressList at all? If you have a resolved
recipient, Recipient.AddressEntry will give you what you need:
smtpaddr = "a...@def.com" 'e.g. for this addess...
Set oAddressList = oSession.AddressLists("Global Address List")
Set oRecipients = ns.CreateRecipient(smtpaddr)
oRecipients.Resolve
Set objAddrEntry = oRecipients.AddressEntry
postalcode = objAddrEntry.Fields(CdoPR_POSTAL_CODE) 'e.g. get the
Postal_Code
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Hi,
I know the smtp-adresses of several persons and need to get the
information stored in other AdressEntry.fields. At the moment I do it
the following way:
smtpaddr = "a...@def.com" 'e.g. for this addess...
Set oAddressList = oSession.AddressLists("Global Address List")
Set oRecipients = ns.CreateRecipient(smtpaddr)
oRecipients.Resolve
Set objAddrEntry =
oAddressList.AddressEntries(oRecipients.NAME)
'This is the point: Here indexing by .NAME, won't work when more
receipients with the same name exist
postalcode = objAddrEntry.Fields(CdoPR_POSTAL_CODE) 'e.g. get
the Postal_Code
How can I address the addressEntry by an other information than by
name? This doesn't work correctly if more than on receipient with this
name exists.
Thx!
marco