Hallo,
Du musst die Daten direkt aus dem Control extrahieren. Versuch mal folgenden Code:
Delphi-Quellcode:
uses
RichEdit;
...
function StringSave(dwCookie: Longint; pbBuff: PByte;
cb: Longint; var pcb: Longint): Longint; stdcall;
var
S: PString;
begin
Result := NoError;
S := PAnsiString(dwCookie);
try
S^ := S^ + PChar(pbBuff);
pcb := cb;
except
Result := $0002; // WriteError
end;
end;
function SaveRichEditToString(RichEdit: TRichEdit): AnsiString;
var
EditStream: TEditStream;
TextType: LongInt;
S: AnsiString;
begin
try
with EditStream do
begin
dwCookie := Integer(@S);
pfnCallBack := @StringSave;
dwError := 0;
end;
if RichEdit.PlainText then
TextType := SF_TEXT
else
TextType := SF_RTF;
SendMessage(RichEdit.Handle, EM_STREAMOUT, TextType, Longint(@EditStream));
finally
Result := S;
end;
end;
Gruß
xaromz