Beiträge von john stickley

    Ithanks for the reply - I probably didn't make the request clear.

    I only want the amended (edited) text to have a coloured background - this is so that when the document is returned to the author they can see the changes made (these will generally be added text).

    Using the write attribute works well apart from within the part of the document that is composed of tables where the default behaviour occurs.

    I want the default font background to be yellow when I edit a document (stored in SQL server), I use the following code

    editorWPRichText.WritingAttr.SetBGColor(clYellow);

    this works well in documents generally but if the document has a table in it the font background does not change and the default behaviour occurrs.

    How can I make this WritingAttr work for all of the document?

    I was rather concerned - as when I used the same code with a different RTF control it worked ok!

    I tried freeing the stream (I was using TStream) - no luck

    The problem was not clearing the contents of the <blob> field before writing the results!

    All is well again, and thanks for your help

    I am using WPTools to create reports using EKrtf to merge the data from a template.
    Rather than create files everything is done with streams.
    All works well in that the document is created and saved - however when the user edits the documents the data is not saved in a consistent fashion :? ie sometimes when parts are deleted and saved they re-appear when the document is opened.
    The code I use is:

    try
    picuDataModule.document_templatesTable.Edit();
    stream_read_write.position := 0;
    document_browserForm.editorWPRichText.SaveToStream(stream_read_write);
    picuDataModule.document_templatesTable.Post();
    picuDataModule.document_templatesTable.CommitUpdates();
    document_browserForm.editorWPRichText.Clear();
    except
    MessageDlg('Unable to save changes to document template - please check!',mtInformation, [mbOK], 0);
    end;

    Any help gratefully received
    John

    I am using the following code to read documents from a database, the first one updates the preview correctly. The subsequent documents opened do not update the preview.

    pimForm.stream_read_write := picuDataModule.admisStoredProc.CreateBlobStream(picuDataModule.admisStoredProc.FieldByName('discharge_summary_document'), bmReadWrite);
    with document_browserForm.editorWPRichText do
    begin
    // clear current contents
    Clear;
    Refresh;
    // reset stream.read position to start of stream - otherwise read.position at end > no data copied
    pimForm.stream_read_write.position := 0;
    LoadFromStream(pimForm.stream_read_write);
    Refresh;
    end;

    Is there a way to update the preview - I tried refresh(), that however seemed to crash!

    Any help gratefully received
    John