 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
lsg Guest
|
Posted: Wed Dec 10, 2003 11:27 pm Post subject: How to get the address list from MS Exchange Server? |
|
|
Hi,
I would like to get the mailing address list from MS exchange
Server and put them in my NMSMTP1.PostMessage.ToAddress.Text.
Can someone teach me how to do it?
Thanks.
lsg
|
|
| Back to top |
|
 |
Ivan Borissov Guest
|
Posted: Thu Dec 11, 2003 7:23 am Post subject: Re: How to get the address list from MS Exchange Server? |
|
|
See
http://www.imibo.com/imidev/delphi/les/index.html
- Extended MAPI in DELPHI
(Microsoft Exchange Server 5.5 / Microsoft Exchange Server 2000 compatibles
/ DELPHI 5, 6, 7 compatibles)
- Example # 2 Retrieve MS Exchange GAL (Global Address List)
or/and
http://www.imibo.com/imidev/delphi/les/cdoless.html
- CDO 1.2.1 in DELPHI
(MS Exchange Server 5.5 Edition / Microsoft Exchange Server 2000 compatibles
/ DELPHI 5 Edition / DELPHI 6 compatibles)
- Example # 2 Retrieve MS Exchange GAL (Global Address List)
"lsg" <samuelling (AT) hotmail (DOT) com> wrote
| Quote: |
Hi,
I would like to get the mailing address list from MS exchange
Server and put them in my NMSMTP1.PostMessage.ToAddress.Text.
Can someone teach me how to do it?
Thanks.
lsg
|
|
|
| Back to top |
|
 |
Eric Engler Guest
|
Posted: Thu Dec 11, 2003 3:32 pm Post subject: Re: How to get the address list from MS Exchange Server? |
|
|
Try this (you need to add MAPI and ComObj to uses):
procedure TForm1.BtnGetUsersClick(Sender: TObject);
var
OutlookApp, MapiNamespace, AddrList, AddressEntries: Variant;
AddrEntry: string;
begin
//Get the Outlook Application object.
OutlookApp := CreateOleObject('Outlook.Application');
//Get the MAPI NameSpace object.
MapiNamespace := OutlookApp.GetNameSpace('MAPI');
AddrList := MapiNamespace.AddressLists('Global Address List');
AddressEntries := AddrList.AddressEntries;
try
try
ListBox1.Items.Clear;
AddrEntry := AddressEntries.GetFirst;
repeat
ListBox1.Items.Add(AddrEntry);
AddrEntry := AddressEntries.GetNext;
until false;
except
// we must be at the end
end;
finally
ListBox1.Items.Add(AddrEntry);
OutlookApp := NULL;
end;
end;
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|