ContactItem vs AddressEntry

  • Thread starter Thread starter miaplacidus
  • Start date Start date
M

miaplacidus

I can pull data out of the contacts list using something
like strAnswer = objContact.BusinessTelephoneNumber. This
works fine if you are searching in your contacts folder. I
would like to do the same thing for an AddrssEntry in the
address book "Global Addrss List".

I can locate an AddressEntry using something like Set
myEntry = myAddrEntries(myCurrName)

But once I have myEntry I can't figure out how to get the
data out. Is this possible, or is the only access to the
address book through the .details method? Obviously a
modal dialog box that stops the process won't help much.
 
Various details like that for AddressEntry objects aren't exposed in the
Outlook object model. You have to use CDO 1.21 (optional installation for
Outlook 2000 and later) or Extended MAPI (C++ or Delphi code only) or
Redemption (www.dimastr.com/redemption) code for that using the MAPI
properties for the information you want.

See www.cdolive.com/cdo5.htm for CDO 1.21 code samples and
www.cdolive.com/cdo10.htm for various AddressEntry property tags, many of
which are undocumented. Redemption code samples are on the Redemption Web
site.
 
I was afraid of that. Meanwhile I have a temporary fix
that pops up the AddressEntry.detail form. but before it
pops up I get a warning message from outlook that
says "another program is trying to access email addresses
stored in outlook. Do you want to allow this?"

Can I bypass that message?
 
If your code in running in a COM addin or Outlook VBA project in Outlook
2003 the warning won't appear if you derive all your Outlook objects from
the Application object passed to you in On_Connection in a COM addin or the
intrinsic Application object in Outlook VBA.

Otherwise you would need to use Extended MAPI code or Redemption code to
avoid the prompt, or permit the methods and properties you need in the
Outlook security form if you are using Exchange server, or use Express
ClickYes which uses SendKeys to answer the prompts. I think ClickYes has
some security problems, I use Redemption myself. And using that I can get at
the MAPI properties of an AddressEntry object so I don't need any
workarounds and can read the properties if I need to use them in code.
 
Back
Top