Etwa so (das Pos kannst du dir sparen):
Delphi-Quellcode:
for i := 1 to High(Smilie) do
while ChatBox.FindText(Smilie[i], 0, -1, [stMatchCase]) >= 0 do begin
ChatBox.SelLength := Length(Smilie[i]);
ChatBox.SelText := '';
AddImageToRichEdit(GetImageIndex(Smilie[i]));
end;