This does the trick. Thanks all, really done this time.
procedure TForm1.Quote;
const C_BOOL2HTML_ITALIC: array[boolean] of string = ('<i>', '</i>');
var i : integer;
s : string;
InQuote: boolean;
before, after : string;
begin
Memo2.Lines.Clear;
for i := 0 to Memo1.Lines.Count-1 do
begin
s := Memo1.Lines[i];
InQuote := false;
while pos('"',s) > 0 do
begin
s := StringReplace(s, '"', C_BOOL2HTML_ITALIC[InQuote], []);
InQuote := not InQuote;
end;
if InQuote then
s := s + C_BOOL2HTML_ITALIC[InQuote];
Memo2.Append(s);
end;
Memo1.Text := Memo2.Text;
Application.ProcessMessages;
Memo1.Text := StringReplace(Memo1.Text, '<i>', '<i>"',
[rfReplaceAll, rfIgnoreCase]);
Memo1.Text := StringReplace(Memo1.Text, '</i>', '"</i>',
[rfReplaceAll, rfIgnoreCase]);
end;