Einzelnen Beitrag anzeigen

Delphi-Lover

Registriert seit: 19. Okt 2004
Ort: Amsterdam
30 Beiträge
 
Delphi 2005 Professional
 
#1

Outlook, how to add an address in a distribution list

  Alt 19. Okt 2004, 10:35
Hello,

I've tried to add a new mailaddress in an addresslist, but I got an error when doing so. I can not find an other way to add an address.

Thanks a lot,

Delphi-Lover.

Delphi-Quellcode:
Var obj, Entry, NewMember : OleVariant;
begin
  obj := CreateOleObject('outlook.application');
  obj := obj.GetNameSpace('MAPI');

  //Create an new distribution list
  //AddressList(6) is my personal addressbook
  Entry:=obj.AddressLists(6).AddressEntries.Add('MAPIPDL','New List');
  Entry.Update;

  NewMember:=Entry.members;
  //Error Here:
  NewMember.Add('SMTP','NewName');
End;
[edit=sakura] inserted the [delphi] tags Mfg, sakura[/edit]
Rob
  Mit Zitat antworten Zitat