NKTWAB Delphi examples

20 views
Skip to first unread message

alexander goldberg

unread,
Nov 13, 2007, 10:06:13 AM11/13/07
to Nektra-NKTWAB
Last year somebody posted link to Delphi NKTWAB sources in the group.
Unfortunately this link is dead. Have anyone the copy of the Delphi
sources?

Harald Binkle

unread,
Nov 13, 2007, 10:11:36 AM11/13/07
to Nektra-NKTWAB

Here is a simple example what I do with NKTWAB:

 

Function GetMailAddressesFromContacts: TTNTStrings;

var wab:INKTWAB;

    rootFolder:IFolder;

 

  //RecursFolder

  procedure RecursFolder(folder:IFolder);

  var nextFolder:IFolder;

      folders:IFolders;

      contacts:IContacts;

      cont:IContact;

      i,count:integer;

      addr:WideString;

  begin

    //add Addresses

    folder.Get_Contacts(contacts);

    contacts.Get_Count(count);

    for I := 1 to count do

      begin

        contacts.Get_Item(i,cont);

        addr:='';

        cont.Get_DefaultEmailAddress(addr);

        if IsCorrectEMailEx(addr) then result.Add(addr);

        cont.Get_Email1Address(addr);

        if IsCorrectEMailEx(addr) then result.Add(addr);

        cont.Get_Email2Address(addr);

        if IsCorrectEMailEx(addr) then result.Add(addr);

        cont.Get_Email3Address(addr);

        if IsCorrectEMailEx(addr) then result.Add(addr);

      end;

    //recurse subfolders

    folder.Get_Folders(folders);

    folders.Get_Count(count);

    for I := 1 to count do

      begin

        folders.Get_Item(i,nextFolder);

        RecursFolder(nextFolder);

      end;

  end;

  //RecursFolder end

 

begin

  result:=TTNTStringList.Create;

  wab:=CoNKTWAB.Create;

  wab.Get_RootFolder(rootFolder);

  RecursFolder(rootfolder);

end;

 

 

Greetings

 

Harry

 

 

> -----Original Message-----

> From: Nektra...@googlegroups.com [mailto:Nektra-

> NKT...@googlegroups.com] On Behalf Of alexander goldberg

> Sent: Tuesday, November 13, 2007 4:06 PM

> To: Nektra-NKTWAB

> Subject: [Nektra-NKTWAB] NKTWAB Delphi examples

alexander goldberg

unread,
Nov 14, 2007, 1:48:57 AM11/14/07
to Nektra-NKTWAB
Harald, thank you very much.
Reply all
Reply to author
Forward
0 new messages