View Single Post
  #1  
Old October 16th 06, 02:29 AM posted to microsoft.public.outlook.program_vba
Kryer
external usenet poster
 
Posts: 11
Default Getting "Department" from entry in Global Address List

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").Tex tBox4.Visible = False
End if
End Function

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

Is this possible?

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

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

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"SixSigmaGuy" wrote in message
...
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



Ads
 

Best Credit Cards - Virtual pets - Loans - Credit Card Consolidation - Loans