applying HTML text
Posted: Thu Oct 30, 2025 6:44 pm
				
				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.
			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.