Ich kann damit jetzt nicht so recht was mit anfangen.
Ich habe mal die Funktion eingefügt.
Delphi-Quellcode:
Function Tf_hauptform.FindAttachment(stFilename: string): integer;
var
intIndex: Integer;
found: boolean;
begin
intIndex := -1;
result := -1;
if (Msg.MessageParts.Count < 1) then exit; //no attachments (or anything else)
found := false;
stFilename := uppercase(stFilename);
repeat
inc(intIndex);
if (Msg.MessageParts.Items[intIndex] is TIdAttachment) then
begin //general attachment
if stFilename = uppercase(TIdAttachment(Msg.MessageParts.Items[intIndex]).Filename) then
found := true;
end;
until found or (intIndex > Pred(Msg.MessageParts.Count));
if found then
result := intIndex
else
result := -1;
end;
Was muss ich genau machen, damit TIDAttachment funktioniert?
LG