View Single Post
  #5  
Old April 15th 10, 08:20 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Outlook Macro to get Exchange Info from Mail

So d oyo uwant to access EX specific properties of a contact that was create
in the hContacts folder from one of the GAL entries?
Or EX properties of a message sender/recipient?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"_M_a_t_t_" wrote in message
...
Thanks for the answer Ken.

I can not install the redemption Reference, however I do have Microsoft
CDO
1.21 Reference. I can also use MAPI. Can you provide an example of how to
access the information I'm refering to using either (or both)?

In the example I posted, I can access all the elements of
Outlook.MailItem.
Its the elements of Outlook.ContactItemI'm wanting to access from the
Email
only, and I can not find a way nor an example of how to do this. Only on
how
to access the information from the contact (Contacts saved in Outlook
Address
Book locally) from Outlook.ContactItem via address book.

"Ken Slovak - [MVP - Outlook]" wrote:

You can get the Exchange Global Address List as a member of the
Outlook.AddressLists collection.

You then would have to find the AddressEntry that corresponds to the
sender's AddressEntry in the GAL. From there you could get some of the
property you refer to, just what's exposed for an AddressEntry.

You pretty much would have to iterate the AddressEntries collection in
the
GAL AddressList to find one where the name matched the AddressEntry.Name
property.

What is exposed for an AddressEntry does not include telephone numbers,
country, mailing address or a lot of other things. For those properties
you
would need to use other methods such as Extended MAPI or Redemption
(www.dimastr.com/redemption) or CDO 1.21 or even LDAP queries.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"_M_a_t_t_" wrote in message
...
Hi, I'm working on a macro in Outlook 2003 SP3 that, when started,
displays
an Email in a custom dialog, broken down into elements. The dialog is
used
for Email processing. Upgrading Outlook is not possible, and adding
addons
is
also not possible (other then what is currently installed).

What I'm looking to achieve is, when an Email is from Exchange (company
email), to display the information found when you right click on the
senders
name and choose 'Outlook Properties'. Things displayed here, are, for
example, the address, country & telephone number. The sender is not in
the
contacts in Outlook. I want to get the contact information from the
Email.

I'm accessing the information from the Email with something like this
(I
have seen that MAPI can be used, but I have not found an example that
work
like this, if someone can correct me here, I'd be greatful):

Dim olkItem As Outlook.MailItem

For Each olkItem In Application.ActiveExplorer.Selection

'Read the info and enter it into the dialog

'Example info: MsgBox olkItem.SenderEmailAddress

Next

How can I access the Exchange information from the mail item? I hope I
have
explained this clearly enough.

Thanks for your time.

Office Version:Office 2003 / Operating System:Windows XP


.



Ads