Beiträge von bernd.maierhofer

    Hi + tx for every answer!

    What is the best way to basically deal with RTF strings (= {\rtf1\ansi ...... }) ? I want to convert a plain unformatted ANSI string to RTF, I want to concate RTF strings, I want to remove all formattings from a RTF string, ...

    Is there any RTF engibe I can use for these tasks?

    tx Bernd

    Hi + tx for an answer:

    I use a TDBWPRichText to let the user create RTF text elements. My app merges These elements together. However, sometimes I want to have the final rtf to have only one font, not the individual fonts of the elements.

    So how do I remove all Arial 10 pt from my RTFs and - if necessary - reaplace it by Tahoma 8 pt?

    tx Bernd

    I have a form with a WPEditor which I use to edit a rtf which is later inserted into another rtf. Using the WPEdfitor, I insert a table with width set to 100%. I save the rtf as text to a field of the DB.

    The field in DB contains ...{\tblstart1{....\trftsWidth2\trwWidth5000 which exactly makes the table stretch to the whole width of the doc.

    However, if I reload the rtf from the database into the WPEditor, the \trftsWidth2 is changed to \trftsWidth3\trwWidth6806.

    So after the second edit/save, the table no longer streches over the width of the doc.

    What am I mising?

    tx + brgds bernd

    I use the TDBWPRichText to create RTF pieces, that afterwards get assembled to one big RTF, that is loaded in WORD or WORDPAD.

    I create my RTF-Part 1 in the control and save it to a BLOB in MSSQL using RTF as format.

    However, data for graphics is duplicated:

    Word displays then all the numbers and then the image. Any idea, how to change this behaviour?

    BTW: I am pretty sure, this is new with the last update.

    Workaround:

    Do not set Datasource and Datafield of the TDBWPRichText.
    Create the form.
    Retrieve data.
    Set Datasource and Datafield (see code below).

    Code
    with TFrmTextbaustein.Create(CForm(Self)) do begin
      mlRTFText.DataSource:=frmTextbausteinList.dsTextbaustein;
      mlRTFText.DataField:='TEXTBAUSTEIN';
         if ShowModal=idOk then begin

    Conclusion: This must be a timing problem. Retrieveing data prior to having set properties, that influences the behaviour.

    Additional info:
    I verified, that the data is not truncated.
    Edit/Save/Reload from the DB does not change the RTF.
    If I disconnect the control from the datafield, the error does not occur.
    If I edit the rtf with the editor component (see code below), no error occurs and the RTF is displayed ok.

    Hi + tx for any info.

    Using WP 6.25m MS SQL 2008 R2

    I have a TDBWPRichText connected to a TQuery and a Field of tye TMemoField - undrlying DB type is TEXT. I finally managed to save my RTF with graphics included to the DB setting the wobRTFnobinary.

    However, when I now try to load the saved RTF into the TDBWPRichText, I receive a "list index of ouf bounds".

    Can anybody direct me how to save/rsetore RTFs with graphics embedded to the database?

    tx Bernd