Thema: Delphi outlook mail auslesen

Einzelnen Beitrag anzeigen

Delphi-Lover

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

Re: outlook mail auslesen

  Alt 10. Okt 2006, 09:30
Hello,

Try to run from index 1 instead of index 0...

Delphi-Quellcode:
Function TMailTrans.GetInboxItemBySender(aSender : String) : Variant;
Var Index : Integer;
    aMailItem : Variant;
Begin
  Result:=NULL;
  For Index := InboxFolder.Items.Count downto 1 do
  begin
    aMailItem:=InboxFolder.Items.Item(Index);
    If aMailItem.sendername=aSender Then Result:=aMailItem;
  end;
End;
Better to run from last item to the first. If you delete in a loop a mailitem then the order of the mailitems will change and ofcourse the count will also change.

Greets,

Delphi-Lover.
Rob
  Mit Zitat antworten Zitat