trichview.com

trichview.support




Re: Merging data from one TDBRichViewEdit To TRichViewEdit


Return to index


Author

Message

Fredrik Larsson

Posted: 02/25/2003 23:44:08


Brilliant! It did the trick.


Regarding the exception it seem to have something to do with the last item

being tagged. If I add normal text after the coded item it works. The code

is as per below. And it is the DBRichViewEdit I am using. I will try to do

an example and send to you. Note that the exception is in the

previewedit.format part.


var

  lIndex: Integer;

  lText: string;

begin


  PreviewEdit.Clear;


  for lIndex := 0 to DesignEdit.ItemCount - 1 do

  begin


    lText := '';

    PreviewEdit.CurTextStyleNo := 0;


    if (DesignEdit.IsFromNewLine(lIndex)) And (lIndex <> 0) then

      lText := lText + #13#10;


    if DesignEdit.RVData.GetItemStyle(lIndex)>=0 then

    begin


      if string(DesignEdit.GetItemTag(lIndex)) <> '' then

      begin

        lText := lText + '<REPLACE>';


      end

      else

      begin


        lText := lText + DesignEdit.GetItemText(lIndex);


      end;


    end;


    if lText <> '' then

      PreviewEdit.InsertText(lText);


  end;


  previewedit.Format;

end;





Powered by ABC Amber Outlook Express Converter