Page 1 of 1

applying HTML text

Posted: Thu Oct 30, 2025 6:44 pm
by tiagosis
Hi, how can I apply formatted HTML to TSRichViewEdit?

I'm using the following code, and in some places it works, and in others it simply replaces <b></b> with ****

//obtendo o retorno HTML
htmlStreamRetorno := TStringStream.Create;
memHTMLString.Clear;
memHTMLString.Text := _fieldvalue;
memHTMLString.Lines.SaveToStream(htmlStreamRetorno,TEncoding.UTF8);
htmlStreamRetorno.Position := 0;

//convertendo o html para docx
docXStream := TStringStream.Create;
SRichViewEditAux.Clear;
SRichViewEditAux.ActiveEditor.LoadHTMLFromStream(htmlStreamRetorno,'',CP_UTF8);
SRichViewEditAux.ActiveEditor.SaveDocXToStream(docXStream,false);
docXStream.Position := 0;


in TSRichViewEdit:
RichViewEdit.InsertDocXFromStreamEd(_fieldValue);


Notice that he correctly changed the text to bold at the beginning, but then failed to do so for the names of the people.

Re: applying HTML text

Posted: Thu Oct 30, 2025 6:45 pm
by tiagosis
image

Re: applying HTML text

Posted: Thu Oct 30, 2025 8:28 pm
by tiagosis
I found the problem and it was a flaw in my code, thank you.