Free Support Forum -

Run.Text and HTML

How can I insert some HTML into a run? I have some code that creates a header paragraph and applies a style to it, then creates another paragraph / run and inserts some dynamic content into that. The content comes from a HTML text editor, so there are paragraph tags, etc., that need to be escaped out.

I’ve seen examples of how to do this with the document builder, but I’m not using that. How can I accomplish this without it?



Thanks for your request. Unfortunately, there is no other way to insert HTML content into the document except using DocumentBuilder. If you need to insert HTML into a Run node, you should move DocumentBuilder cursor to this Run and insert HTML.

Best regards,

I find that a little weird, but using the document builder seems to work. I inserted the paragraph where I needed it and then move the builder to that paragraph and insert the html from there.


Hi Jason,

It's great that things are working as expected. If you have any further queries, please feel free to ask.