applying HTML text

General TRichView support forum. Please post your questions here
Post Reply
tiagosis
Posts: 67
Joined: Thu Apr 13, 2017 5:34 pm

applying HTML text

Post 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.
tiagosis
Posts: 67
Joined: Thu Apr 13, 2017 5:34 pm

Re: applying HTML text

Post by tiagosis »

image
Attachments
Screenshot_1.png
Screenshot_1.png (124.81 KiB) Viewed 17 times
tiagosis
Posts: 67
Joined: Thu Apr 13, 2017 5:34 pm

Re: applying HTML text

Post by tiagosis »

I found the problem and it was a flaw in my code, thank you.
Post Reply