Getting "Department" from entry in Global Address List

G

Guest

Hi,

When I'm using Outlook and double click on a resolved name in the address
field of an email, a dialog box opens showing several properties of that
entry. One of the properties is "Department". I'm trying to write code that
will retrieve the "Department" name for entries in the GAL, but I can't
figure out how to do it? Can anyone tell me how to get the "Department" name
for an entry?

I see how to get it for a contact in the contacts folder, but not for the GAL.

Thanks,

Rick
 
D

David C. Holley

Can't help you with that, but thought it interesting that I'd see a post
from a ASQ person since I was just on the phone with them today.
 
G

Guest

I didn't even realize it said that. Actually, I'm not an ASQ person, I was
certified through Juran Corporation. My email is (e-mail address removed) if
you want to discuss Six Sigma offline.

Rick
 
K

Ken Slovak - [MVP - Outlook]

A GAL entry is not a contact but it is an AddressEntry among the
AddressEntries collection of the GAL AddressList. Unfortunately Department
is not exposed to the Outlook object model for AddressEntry objects. You
would have to use a different API such as CDO 1.21 (optional installation
for Outlook 2000 and later) or Extended MAPI (C++ or Delphi only) or
Redemption (3rd party library at www.dimastr.com/redemption).

The property tag you would use for Department in one of those other API's is
PR_DEPARTMENT_NAME (0x3A18001E).

You can see examples of CDO 1.21 code at http://www.cdolive.com/cdo5.htm
 
G

Guest

Actually, I still ran into a couple of problems.

1. It doesn't explain how to install CDO or where to get it from. I've
looked around and can't find it. Can you tell me where to get it?
2. The variable/object "item" is apparently defined globally and not in the
code sample. What kind of variable/object is this and how do I declare it?

Thanks,

Rick "still stuck"
 
M

Michael Bauer

Am Tue, 20 Sep 2005 10:01:04 -0700 schrieb SixSigmaGuy:

Ken answered you question already. You can find CDO on your Office-CD.
 
G

Guest

Ken or Michael -
Along with the AddressEntries collections is the Title exposed to the
Outlook object Model. I am trying to write some VBS for a custom form. On the
form I have a custom text box and I want to say on open of this custom form
that if you title is not equal to Collections Supervisor that the text box
becomes locked or invisible.

The current code I have now is
Function Item_Open()
if ??????? <> "Collections Supervisor" then
Item.GetInspector.ModifiedFormPages("Message").TextBox4.Visible = False
End if
End Function

?????? would be the code for where I would find the address book entry: Title.

Is this possible?
 
G

Guest

The question would be is there a way to do this with out using CDO or
redemption? I work out of a big time corporation and they do not allow add-in
installs on the machines and we are looking at over 1000 people or machines
this would have to be installed even if they did approve it.
 
K

Ken Slovak - [MVP - Outlook]

Sure, do all your coding with Extended MAPI (C++ or Delphi only) and you
don't need any other API's. Other than that you would need CDO, which can be
installed from the Office CD's, or Redemption or some other MAPI wrapper, or
you can use Outlook 2007's PropertyAccessor object.
 
G

Guest

Okay, Thank you Ken for all your help on this.

Ken Slovak - said:
Sure, do all your coding with Extended MAPI (C++ or Delphi only) and you
don't need any other API's. Other than that you would need CDO, which can be
installed from the Office CD's, or Redemption or some other MAPI wrapper, or
you can use Outlook 2007's PropertyAccessor object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top