How to get RTF text from RichViewEdit?
I need get formated text into String (WideString?) and put into another component. Unfortunatly - I can't use Stream (only variable).
How to get RTF text into variable?
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Code: Select all
// TRVAnsiString is defined as String for Delphi 3-2007, and as AnsiString for Delphi 2009+
function GetRTFString(rv: TCustomRichView): TRVAnsiString;
var Stream: TMemoryStream;
begin
Stream := TMemoryStream.Create;
try
rv.SaveRTFToStream(Stream, False);
SetLength(Result, Stream.Size);
Stream.Position := 0;
Stream.ReadBuffer(PRVAnsiChar(Result)^, Length(Result));
finally
Stream.Free;
end;
end;
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: