Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / May 2005

Tip: Looking for answers? Try searching our database.

Q: Help on OL ObectModel (AddressEntries) needed pls

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
marco.prischmann@gmx.de - 30 May 2005 07:51 GMT
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(oR­­­­ecipients.NAME)
'This is the point: Here indexing by .NAME, won't work when more
receipients with the same name exist
postalcode = objAddrEntry.Fields(CdoPR_POST­­­­AL_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_POST­­­­AL_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(oR­­­­ecipients.NAME)
'This is the point: Here indexing by .NAME, won't work when more
receipients with the same name exist
postalcode = objAddrEntry.Fields(CdoPR_POST­­­­AL_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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.