Page 1 of 1

Does RichViewEdit had some property to get it's plain text?

Posted: Tue Sep 20, 2005 2:49 am
by gcw5zb
Does it had?I can get the text ,but is there any simple way like "richedit.text"?

Posted: Tue Sep 20, 2005 7:12 am
by Sergey Tkachenko
s := GetAllText(rv); // function from RVGetText unit

Posted: Thu Feb 03, 2011 6:19 am
by alanmcd
If I just do this from a form

Code: Select all

var
  sItemDes: String;
begin
          sItemDes := GetAllText(frmeMEItemList1.DBRichViewEdit1);
          Showmessage(sItemDes);

end;

I see the text excluding format codes which is what I want.

But if I do this via code:

Code: Select all


            LoadRVFFromField(rvHidden, SchoolDB.IB_QItemListExport, 'RVDESCRIPTION');
          sItemDes := GetAllText(rvHidden);
          Showmessage(sItemDes);

where LoadRVFFromField is as you have it above, I get an empty string.
What might be the issue with this?
Alan

Posted: Thu Feb 03, 2011 9:24 am
by Sergey Tkachenko
The only reason I can imagine is that LoadRVFFromField fails for some reason, or the field is empty.

Posted: Thu Feb 03, 2011 10:04 am
by alanmcd
The field has a value - I can showmessage the value.
The function is:

Code: Select all

function TMEProjectSelect.LoadRVFFromField(rv: TCustomRichView; qry: TIB_Query;
                          const FieldName: String): Boolean;
var Stream: TStream;
begin
  Stream := qry.CreateBlobStream(qry.FieldByName(FieldName), bsmRead);
  try
    Result := rv.LoadRVFFromStream(Stream);
  finally
    Stream.Free;
  end;
end;

Posted: Thu Feb 03, 2011 10:11 am
by alanmcd
sorry - should have been LoadRTFFromStream
Alan