Hi there,
I would like to convert a RTF data in TEXT data avoiding the format characters.
Is it possible ? How can I do that ?
Thanks
Marco
Convertion from RTF to TEXT.
-
- Posts: 6
- Joined: Mon Dec 18, 2006 6:17 pm
-
- Site Admin
- Posts: 17565
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
For example,
Using:
Code: Select all
function SaveTextToField(rv: TCustomRichView; tbl: TTable;
const FieldName: String): Boolean;
var Stream: TStream;
begin
Stream := TMemoryStream.Create;
try
Result := rv.SaveTextToStream('', Stream, 60, False, False);
Stream.Position := 0;
TBlobField(tbl.FieldByName(FieldName)).LoadFromStream(Stream);
finally
Stream.Free;
end;
end;
Code: Select all
Table1.Edit;
SaveTextToField(RichViewEdit1, Table1, 'TextField');
Table1.Post;
-
- Posts: 6
- Joined: Mon Dec 18, 2006 6:17 pm
Hi Sergey,
I tried your suggestion and the text has been saved in the data field. However, some characters have been changed after the process.
e.g.
The original text:
When saving text in text file the problem does not happen.
Do you have any idea how I could solve that ?
Thanks
Marco
I tried your suggestion and the text has been saved in the data field. However, some characters have been changed after the process.
e.g.
The original text:
The text after saved in the data field:artigo 20, inciso III, alínea “b”, da Lei Complementar nº 11/91
See the “ character has been changed by ¿ character .artigo 20, inciso III, alínea ¿b¿, da Lei Complementar nº 11/91
When saving text in text file the problem does not happen.
Do you have any idea how I could solve that ?
Thanks
Marco
-
- Site Admin
- Posts: 17565
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: