Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Outlook Email Addressbook

Posted on 2004-04-01
5
Medium Priority
?
222 Views
Last Modified: 2010-04-05
Hello !
  I've created a little application which get's a list of email addresses from the outlook addressbook (on an exchange server) along with their login name.  

Does anyone know if its possible to just return names (rather than groups) from the email address list ?

Also does anyone know if its possible to return their alias ?  (When you right click a name, chose properties it displays it there).

This is the addressbook NOT the contact list.

Many thanks in advance.
0
Comment
Question by:Togs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 10730940
maybe this can help?

uses Mapi

procedure TForm1.Button1Click(Sender: TObject);
Function GetAddressBookNames(const ToList,CCList,BCCList: TStrings; DialogCaption: String): Boolean;
  type
  AFUlong = Cardinal; //Windows.ULONG Type compatibility for D3
var
  lpRecip: TMapiRecipDesc;
  intRecips: AFULONG;
  lpRecips: PMapiRecipDesc;
  i: Integer;
  NumberOfEditFields: Cardinal ;
begin
  NumberOfEditFields := 0;
  If (ToList <> Nil) or  (CCList <> Nil) or (BCCList <> Nil) then
    Inc(NumberOfEditFields);
  result := False;
  if (MAPIAddress(0, Application.Handle, PChar(DialogCaption),
    NumberOfEditFields, '', 0, lpRecip, 0, 0, @intRecips, lpRecips) =
    SUCCESS_SUCCESS) then
  begin
    If NumberOfEditFields > 0 then
    begin
      for i := 0 to intRecips-1 do
        case PMapiRecipDesc(PChar(lpRecips) + i*SizeOf(TMapiRecipDesc))^.
          ulRecipClass of
          MAPI_TO:
            If ToList <> nil then ToList.Add(PMapiRecipDesc(PChar(lpRecips) +
              i*SizeOf(TMapiRecipDesc))^.lpszName);
          MAPI_CC:
            If CCList <> nil then CCList.Add(PMapiRecipDesc(PChar(lpRecips) +
              i*SizeOf(TMapiRecipDesc))^.lpszName);
          MAPI_BCC:
            If BCCList <> nil then BCCList.Add(PMapiRecipDesc(PChar(lpRecips)
              + i*SizeOf(TMapiRecipDesc))^.lpszName); //.lpszAddress for Address....
        end;
      result := True;
    end;
  end;
  MAPIFreeBuffer(lpRecips);
end;
begin
getaddressbooknames(listbox1.Items,nil,nil,'');
end;
0
 

Author Comment

by:Togs
ID: 10731041
Thanks for that although it doesn't quite help my problem.  

I need to check a login (for example one you log into the network with 'test07' which then has an email account based on this login 'test07').

I have statics in my application which upon certain events automatically email specific logins (for example 'test07').  However when these are removed from the exchange server and not the application it produces problems with my application (allows the users to type their own email addresses in and due to the poor handling of windows in XP also sometimes get stuck behind other windows).
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 13276107
PAQed with points refunded (60)

modulo
Community Support Moderator
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Loops Section Overview
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question